Package net.simplace.sim.control
Class FWSimulationControlContainer
java.lang.Object
net.simplace.sim.control.FWSimulationControlContainer
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
FWSimulationGenerator,FWSimulationIterator,FWSimulationSelector
The simulation generator creates for existing project (
FWSimProject )
a range of simulations ( FWSimSimulation ). This abstract class has 2
implementations:
SimpleSimulationGenerator: Final class used for FWSimProject.PROJECT_MODE.SIMULATION and
FWSimVariable.CONTENT_TYPE.sim. It just delivers the (few) simulations in
the selected project.
DefaultSimulationGenerator: Class used for all FWSimProject.PROJECT_MODEs but
FWSimVariable.CONTENT_TYPE.res. Use this class to override and create own
SimGenerator plug-ins.
Method #generate(FWSimSimulation) has to be implemented in extending classes.- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FWSimulationControlCacheCache reference to access data directly in the control processprotected HashMap<String,FWSimCalibrationVariable<?>> Variables that are used as calibration variables that are interchanged between the generated simulationsprotected net.simplace.sim.control.FWSimulationControlContainer.ConstraintVariables that are used as constraints of initiation of calibration variablesprotected org.jdom2.ElementElementthe Simulation creator is configured from.protected FWSimVarMapCentrally used VarMap referenceprotected LinkedHashMap<String,FWSimVariable<?>> initial field map as given by the createVariables()-Method in the SimComponent implementationregistered links of the SimComponent implementationprotected LinkedHashMap<String,FWSimVariable<?>> Variables that are used as inputs defining the needed configurations for running the generatorprotected StringName of componentprotected HashMap<String,FWSimVariable<?>> Variables that are used as parameters of initiation of calibration variablesprotected FWSimSessionthe current used sessionprotected FWSimVarMapCentrally used VarMap reference -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFWSimulationControlContainer(org.jdom2.Element aContainerElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap) Default constructor of the abstract class that has to be called from overriding classes. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessTime(long aProcessTime) adds the processTimevoidaddVariable(FWSimVariable<?> aVariable) Add Variable to the Filed map.voidcheckCondition(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.protected booleanevaluate(FWSimVarMap aVarMap, Boolean aDefault) Evaluate whether aVarMap satisfies the given constraintorg.jdom2.Elementorg.jdom2.ElementgetEditFormXML(boolean aEnabled) returns the input variables from FieldMapgetName()intgetVariable(String aKey) protected abstract voidinit()The model initialization function.booleanprotected voidvoidremoveVariable(String aID) Remove variable from FieldMap - handle with care!voidsetPropertyValue(String aKey, Object aValue) org.jdom2.ElementtoXML()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.simplace.sim.util.FWSimFieldContainer
createVariables
-
Field Details
-
iName
Name of component -
iCache
Cache reference to access data directly in the control process -
iControlMap
Centrally used VarMap reference -
iSimulationMap
Centrally used VarMap reference -
iFieldMap
initial field map as given by the createVariables()-Method in the SimComponent implementation -
iInputMap
registered links of the SimComponent implementation -
iContainerElement
protected org.jdom2.Element iContainerElementElementthe Simulation creator is configured from. -
iInputs
Variables that are used as inputs defining the needed configurations for running the generator -
iCals
Variables that are used as calibration variables that are interchanged between the generated simulations -
iParams
Variables that are used as parameters of initiation of calibration variables -
iSession
the current used session -
iConstraint
protected net.simplace.sim.control.FWSimulationControlContainer.Constraint iConstraintVariables that are used as constraints of initiation of calibration variables
-
-
Constructor Details
-
FWSimulationControlContainer
public FWSimulationControlContainer() -
FWSimulationControlContainer
protected FWSimulationControlContainer(org.jdom2.Element aContainerElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap) Default constructor of the abstract class that has to be called from overriding classes.- Parameters:
aContainerElement-aSession-aFieldMap-
-
-
Method Details
-
readInputCalAndConstraint
protected void readInputCalAndConstraint() -
init
protected abstract void init()The model initialization function. Will be called only once, before running the model using process(). -
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumberin interfaceFWSimFieldContainer- Returns:
- number in the order of Components
- See Also:
-
getContentType
- Specified by:
getContentTypein interfaceFWSimFieldContainer- Returns:
- number in the order of Components
- See Also:
-
addVariable
Add Variable to the Filed map. This should be called in implementing classes within the method "createVariables".- Specified by:
addVariablein interfaceFWSimFieldContainer- Parameters:
aVariable-
-
evaluate
Evaluate whether aVarMap satisfies the given constraint- Parameters:
aVarMap-aDefault-- Returns:
- the boolean result of the evaluation
-
getVariable
- Specified by:
getVariablein interfaceFWSimFieldContainer- Parameters:
aKey-- Returns:
- one SimVariable registered for given key
- Throws:
SimFieldMissingException- if Variable is Null
-
setPropertyValue
- Parameters:
aKey-aValue-- Throws:
SimFieldMissingException- if Variable is Null
-
removeVariable
Remove variable from FieldMap - handle with care!- Specified by:
removeVariablein interfaceFWSimFieldContainer- See Also:
-
getName
- Specified by:
getNamein interfaceFWSimFieldContainer- Returns:
- the Name of the component
- See Also:
-
getInputVariables
returns the input variables from FieldMap- Specified by:
getInputVariablesin interfaceFWSimFieldContainer- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getOutputVariables
- Specified by:
getOutputVariablesin interfaceFWSimFieldContainer- Returns:
- the OutputVariables from the FieldMap
- See Also:
-
addProcessTime
public void addProcessTime(long aProcessTime) adds the processTime- Parameters:
aProcessTime-
-
getFieldMap
- Specified by:
getFieldMapin interfaceFWSimFieldContainer- Returns:
- whole field map as created in createVariables()
- See Also:
-
getVarMap
- Specified by:
getVarMapin interfaceFWSimFieldContainer- Returns:
- number in the order of Components
-
toXML
public org.jdom2.Element toXML()- Specified by:
toXMLin interfaceFWSimFieldContainer- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getCreateFormXML
public org.jdom2.Element getCreateFormXML()- Specified by:
getCreateFormXMLin interfaceFWSimFieldContainer- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Specified by:
getEditFormXMLin interfaceFWSimFieldContainer- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getFrequence
- Specified by:
getFrequencein interfaceFWSimFieldContainer- Returns:
- the Frequence of the Container calling
-
checkCondition
Description copied from interface:FWSimFieldContainerCalled from inside the FWSimFieldContainer to log the initialization Errors.- Specified by:
checkConditionin interfaceFWSimFieldContainer
-
isConditionCheck
public boolean isConditionCheck()- Specified by:
isConditionCheckin interfaceFWSimFieldContainer
-