Class FWSimulationIterator
java.lang.Object
net.simplace.sim.control.FWSimulationControlContainer
net.simplace.sim.control.FWSimulationIterator
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
DefaultSimulationIterator
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 Summary
FieldsModifier and TypeFieldDescriptionnot used (hides the field of the base class)protected intmaximum number of iterationsFields inherited from class FWSimulationControlContainer
iCache, iCals, iConstraint, iContainerElement, iControlMap, iFieldMap, iIdentifier, iInputs, iName, iParams, iSession, iSimulationMap -
Constructor Summary
ConstructorsConstructorDescriptionFWSimulationIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession) Creates the iterator: registers the iteration variable, reads inputs, calibration variables and constraint and initializes it. -
Method Summary
Modifier and TypeMethodDescriptionstatic FWSimulationIteratorcreateSimulationIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession) Factory method: creates the iterator of the class given in the attributeclassvia its constructor(Element, FWSimSession), or aDefaultSimulationIteratorwithout element.HashMap<String, FWSimVariable<?>> Creates the inputmaxCount(maximum number of iterations, default 1).protected Integerintprotected voidinit()Takes overkeepIterationsandmaxCount.protected abstract booleanDecides whether another iteration is run.Methods inherited from class FWSimulationControlContainer
addProcessTime, addVariable, checkCondition, evaluate, getContentType, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getInputVariables, getName, getOrderNumber, getOutputVariables, getVariable, getVarMap, isConditionCheck, readInputCalAndConstraint, removeVariable, setPropertyValue, toXML
-
Field Details
-
iMaxRunCount
protected int iMaxRunCountmaximum number of iterations -
iInputMap
-
-
Constructor Details
-
FWSimulationIterator
Creates the iterator: registers the iteration variable, reads inputs, calibration variables and constraint and initializes it.- Parameters:
aSimulationIteratorElement- theiteratorelement, may benullaSession- the session
-
-
Method Details
-
iterate
Decides whether another iteration is run.- Parameters:
aProjectID- id of the project, ornullin GLOBAL calibration mode- Returns:
trueif another iteration is run
-
createVariables
Creates the inputmaxCount(maximum number of iterations, default 1).- Returns:
- the variables, keyed by name
- See Also:
-
init
protected void init()Takes overkeepIterationsandmaxCount.- Specified by:
initin classFWSimulationControlContainer
-
createSimulationIterator
public static FWSimulationIterator createSimulationIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession) Factory method: creates the iterator of the class given in the attributeclassvia its constructor(Element, FWSimSession), or aDefaultSimulationIteratorwithout element. Errors are logged.- Parameters:
aSimulationIteratorElement- theiteratorelement, may benullaSession- the session- Returns:
- the iterator, or
nullif it cannot be created
-
getIterationCount
- Returns:
- the current iteration from the control cache
-
getMaxIterationCount
public int getMaxIterationCount()- Returns:
- the maximum number of iterations
-