Package net.simplace.sim.components
Class DefaultManagement
java.lang.Object
net.simplace.sim.model.FWSimComponent
net.simplace.sim.components.DefaultManagement
- All Implemented Interfaces:
FWSimManagementComponent
,FWSimFieldContainer
Management works with configuration like
true
${vCropName}
true
actions can be taken from resources, too. reserved name for this is
actions
- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from class net.simplace.sim.model.FWSimComponent
FWSimComponent.TEST_STATE
-
Field Summary
Modifier and TypeFieldDescriptionprotected MultiHashMap<JexlRuleScript,
FWSimVariable<?>> ActionMap for components that override thisFields inherited from class net.simplace.sim.model.FWSimComponent
iFieldMap, iFrequence, iInputMap, iJexlRule, iMasterComponentGroup, iName, iOrderNumber, isComponentGroup, iSimComponentElement, iSimModel, iVarMap
-
Constructor Summary
ConstructorDescriptioncalled by class.forName()DefaultManagement
(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, MultiHashMap<JexlRuleScript, FWSimVariable<?>> aActionMap, List<String> aFieldModifiedList, List<String> aResetFieldList, FWSimVarMap aVarMap, int aOrderNumber) /** called by test and clone -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bind()
The model initialization function.boolean
protected FWSimComponent
clone
(FWSimVarMap aVarMap) clone management without reading all params again.creates output variables from action variablesvoid
fills the action MapfillTestVariables
(int aParamIndex, FWSimComponent.TEST_STATE aDefineOrCheck) called for single component test to check the components algorithm.protected void
init()
fill action map from configuration elementboolean
performEvent
(ArrayList<FWSimVariable<?>> aActionList) protected void
process()
checks all rules and updates the fieldsboolean
resetVariables
(ArrayList<FWSimVariable<?>> aActionList) void
start()
runs the process mehtod (protected visibility).org.jdom2.Element
toXML()
Name of the ComponentMethods inherited from class net.simplace.sim.model.FWSimComponent
addVariable, checkCondition, createSimComponent, createSimComponent, createSimComponent, createSimComponent, doProcess, getConstantVariables, getCreateFormXML, getDescription, getEditFormXML, getFieldMap, getFrequence, getFrequenceRuleScript, getInputs, getInputVariables, getMasterComponentGroup, getName, getOrderNumber, getOutputVariables, getVariable, getVariableField, getVarMap, initialize, isConditionCheck, isVariableAvailable, performLinks, performLinks, readInputs, removeVariable, reset, runComponentTest, setVariablesDefault, toComponentLinkingXML, toDocXML, toGroupXML, toOutputDefinitionXML, toResourcesDataXML, toResourcesDefinitionXML, toString, writeVarInfos
-
Field Details
-
iActionMap
ActionMap for components that override this
-
-
Constructor Details
-
DefaultManagement
public DefaultManagement(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, MultiHashMap<JexlRuleScript, FWSimVariable<?>> aActionMap, List<String> aFieldModifiedList, List<String> aResetFieldList, FWSimVarMap aVarMap, int aOrderNumber) /** called by test and clone- Parameters:
aName
-aFieldMap
-aInputMap
-aSimComponentElement
-aActionMap
-aVarMap
-aOrderNumber
-
-
DefaultManagement
public DefaultManagement()called by class.forName()
-
-
Method Details
-
getActionMap
- Returns:
- the actionMap
-
bind
protected void bind()Description copied from class:FWSimComponent
The model initialization function. Will be called only once, before running the model using process().- Overrides:
bind
in classFWSimComponent
-
fillActionMap
public void fillActionMap()Description copied from interface:FWSimManagementComponent
fills the action Map- Specified by:
fillActionMap
in interfaceFWSimManagementComponent
- See Also:
-
createVariables
creates output variables from action variables- Specified by:
createVariables
in interfaceFWSimFieldContainer
- Specified by:
createVariables
in classFWSimComponent
- Returns:
- variables from the field map
- See Also:
-
init
protected void init()fill action map from configuration element- Specified by:
init
in classFWSimComponent
- See Also:
-
start
public void start()runs the process mehtod (protected visibility). -
process
protected void process()checks all rules and updates the fields- Specified by:
process
in classFWSimComponent
- See Also:
-
clone
clone management without reading all params again.- Specified by:
clone
in classFWSimComponent
- Returns:
- the deep clone of the SimComponent
- See Also:
-
getContentType
- Specified by:
getContentType
in interfaceFWSimFieldContainer
- Overrides:
getContentType
in classFWSimComponent
- Returns:
- number in the order of Components
- See Also:
-
checkForAction
public boolean checkForAction()- Specified by:
checkForAction
in interfaceFWSimManagementComponent
- Returns:
- boolean if Action has to be performed
- See Also:
-
performEvent
- Specified by:
performEvent
in interfaceFWSimManagementComponent
- Returns:
- boolean if Event was successful
- See Also:
-
getLinkedVariableNames
-
resetVariables
- Specified by:
resetVariables
in interfaceFWSimManagementComponent
- Returns:
- true if successful
- See Also:
-
toXML
public org.jdom2.Element toXML()Name of the Component- Specified by:
toXML
in interfaceFWSimFieldContainer
- Specified by:
toXML
in interfaceFWSimManagementComponent
- Overrides:
toXML
in classFWSimComponent
- Returns:
- a xml element with all the settings of this component()
- See Also:
-
fillTestVariables
public HashMap<String,FWSimVariable<?>> fillTestVariables(int aParamIndex, FWSimComponent.TEST_STATE aDefineOrCheck) called for single component test to check the components algorithm. aParamIndex: Used to set up different test cases. Start with 0 - result check with 1 aso- Specified by:
fillTestVariables
in classFWSimComponent
aDefineOrCheck
- : Use TEST_STATE.DEFINE for defining the test default values and TEST_STATE.CHECK for the accepted results- See Also:
-
net.simplace.sim.util.FWSimFieldContainer#fillTestVariables(int aParamIndex, TEST_STATE aDefineOrCheck)
-