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
FieldsModifier 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
ConstructorsConstructorDescriptioncalled 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 voidbind()The model initialization function.booleanprotected FWSimComponentclone(FWSimVarMap aVarMap) clone management without reading all params again.creates output variables from action variablesvoidfills the action MapfillTestVariables(int aParamIndex, FWSimComponent.TEST_STATE aDefineOrCheck) called for single component test to check the components algorithm.protected voidinit()fill action map from configuration elementbooleanperformEvent(ArrayList<FWSimVariable<?>> aActionList) protected voidprocess()checks all rules and updates the fieldsbooleanresetVariables(ArrayList<FWSimVariable<?>> aActionList) voidstart()runs the process mehtod (protected visibility).org.jdom2.ElementtoXML()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:FWSimComponentThe model initialization function. Will be called only once, before running the model using process().- Overrides:
bindin classFWSimComponent
-
fillActionMap
public void fillActionMap()Description copied from interface:FWSimManagementComponentfills the action Map- Specified by:
fillActionMapin interfaceFWSimManagementComponent- See Also:
-
createVariables
creates output variables from action variables- Specified by:
createVariablesin interfaceFWSimFieldContainer- Specified by:
createVariablesin classFWSimComponent- Returns:
- variables from the field map
- See Also:
-
init
protected void init()fill action map from configuration element- Specified by:
initin 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:
processin classFWSimComponent- See Also:
-
clone
clone management without reading all params again.- Specified by:
clonein classFWSimComponent- Returns:
- the deep clone of the SimComponent
- See Also:
-
getContentType
- Specified by:
getContentTypein interfaceFWSimFieldContainer- Overrides:
getContentTypein classFWSimComponent- Returns:
- number in the order of Components
- See Also:
-
checkForAction
public boolean checkForAction()- Specified by:
checkForActionin interfaceFWSimManagementComponent- Returns:
- boolean if Action has to be performed
- See Also:
-
performEvent
- Specified by:
performEventin interfaceFWSimManagementComponent- Returns:
- boolean if Event was successful
- See Also:
-
getLinkedVariableNames
-
resetVariables
- Specified by:
resetVariablesin interfaceFWSimManagementComponent- Returns:
- true if successful
- See Also:
-
toXML
public org.jdom2.Element toXML()Name of the Component- Specified by:
toXMLin interfaceFWSimFieldContainer- Specified by:
toXMLin interfaceFWSimManagementComponent- Overrides:
toXMLin 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:
fillTestVariablesin classFWSimComponentaDefineOrCheck- : 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)
-