Class FWSimulationIterator

java.lang.Object
net.simplace.sim.control.FWSimulationControlContainer
net.simplace.sim.control.FWSimulationIterator
All Implemented Interfaces:
FWSimFieldContainer
Direct Known Subclasses:
DefaultSimulationIterator

public abstract class FWSimulationIterator extends FWSimulationControlContainer
Base class of the iterators of a calibration: an iterator decides whether another iteration (generate, simulate, select) is run. The number of iterations is limited by the input maxCount (default 1); the input keepIterations keeps the data of previous iterations. The iterator is configured by the iterator element of the project file.
Author:
Andreas Enders
  • Field Details

    • iMaxRunCount

      protected int iMaxRunCount
      maximum number of iterations
    • iInputMap

      protected HashMap<String,String> iInputMap
      not used (hides the field of the base class)
  • Constructor Details

    • FWSimulationIterator

      public FWSimulationIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession)
      Creates the iterator: registers the iteration variable, reads inputs, calibration variables and constraint and initializes it.
      Parameters:
      aSimulationIteratorElement - the iterator element, may be null
      aSession - the session
  • Method Details

    • iterate

      protected abstract boolean iterate(String aProjectID)
      Decides whether another iteration is run.
      Parameters:
      aProjectID - id of the project, or null in GLOBAL calibration mode
      Returns:
      true if another iteration is run
    • createVariables

      public HashMap<String, FWSimVariable<?>> createVariables()
      Creates the input maxCount (maximum number of iterations, default 1).
      Returns:
      the variables, keyed by name
      See Also:
    • init

      protected void init()
      Takes over keepIterations and maxCount.
      Specified by:
      init in class FWSimulationControlContainer
    • createSimulationIterator

      public static FWSimulationIterator createSimulationIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession)
      Factory method: creates the iterator of the class given in the attribute class via its constructor (Element, FWSimSession), or a DefaultSimulationIterator without element. Errors are logged.
      Parameters:
      aSimulationIteratorElement - the iterator element, may be null
      aSession - the session
      Returns:
      the iterator, or null if it cannot be created
    • getIterationCount

      protected Integer getIterationCount()
      Returns:
      the current iteration from the control cache
    • getMaxIterationCount

      public int getMaxIterationCount()
      Returns:
      the maximum number of iterations