Package net.simplace.sim.model
Klasse FWSimComponent
java.lang.Object
net.simplace.sim.model.FWSimComponent
- Alle implementierten Schnittstellen:
FWSimFieldContainer
- Bekannte direkte Unterklassen:
DefaultManagement,FWAnalyticsSimComponent,FWSimComponentGroup,FWSimpleSimComponent
- Autor:
- Andreas Enders FWSimComponent is the smallest definable unit of a model It overrides the abstract FWSimFieldContainer with methods init, clone (with reset) and process It contains the algorithms of the scientific model Has to be documented in detail Simulation Modules are similar to the so called ?strategies? in ACE. They can be encapsulated with SimObjects and used in ACE as in SMILE Model Engine. Each FWSimComponent should have its own Unit Test, Input Forms and Result Forms
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected HashMap<String, FWSimVariable<?>> initial field map as given by the createVariables()-Method in the SimComponent implementationprotected FWSimIOAdapter.FREQUENCEfrequence to check if component is executed or notregistered links of the SimComponent implementationprotected JexlRuleScriptrule to check if component is executed or notprotected FWSimComponentGroupIf component is part of a SimComponent Group Main Component mentioned hereprotected StringName of componentprotected intorder number for the serial order of the componentsprotected final booleanInfo about ComponentGroupprotected org.jdom2.Elementoriginal SimComponent configuration element (jdom)protected FWSimModelSimModel reference - can be seen as the thread the component is accessed inprotected FWSimVarMapCentrally used VarMap reference -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedMain constructor for use with Class.forName()protectedFWSimComponent(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, int aOrderNumber) called via clone -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddVariable(FWSimVariable<?> aVariable) Add Variable to the Filed map.protected voidbind()The model initialization function.voidcheckCondition(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.protected abstract FWSimComponentclone(FWSimVarMap aVarMap) static FWSimComponentcreateSimComponent(String aClassname) static FWSimComponentcreateSimComponent(String tName, FWSimVarMap aVarMap, FWSimModel aSimModel, int aOrderNumber) static FWSimComponentcreateSimComponent(org.jdom2.Element aSimComponentElement, FWSimComponentGroup aComponentGroup, FWSimVarMap aVarMap, FWSimModel aSimModel, int aOrderNumber) factory method creating a SimComponentstatic FWSimComponentcreateSimComponent(org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, FWSimModel aSimModel, int aOrderNumber) factory method creating a SimComponentabstract HashMap<String, FWSimVariable<?>> called only once when the SimComponent is created.protected voidThe main model calculation function.abstract HashMap<String, FWSimVariable<?>> fillTestVariables(int aTestIndex, FWSimComponent.TEST_STATE aDefineOrCheck) called for single component test to check the components algorithm.final org.jdom2.Elementorg.jdom2.ElementgetEditFormXML(boolean aEnabled) returns the input variables from FieldMapgetName()intgetVariable(String aKey) protected FWSimVariable<?> getVariableField(String aKey) protected abstract voidinit()The model initialization function.voidThe model initialization function.booleanprotected booleanisVariableAvailable(String aString) voidlinks like given in the input part of the SimComponent configuration are performed.protected voidperformLinks(HashMap<String, String> aLinkMap) protected abstract voidprocess()The main model calculation function.readInputs(org.jdom2.Element aSimComponentElement) voidremoveVariable(String aID) Remove variable from FieldMap - handle with care!protected voidreset(FWSimVarMap aVarMap) static BooleanrunComponentTest(String aComponentClassName, int aTestIndex) called for single component test to check the components algorithm.protected voidThe models writable variables like outputs, states and rates are set to default .org.jdom2.Elementorg.jdom2.ElementtoDocXML()org.jdom2.ElementtoGroupXML(HashSet<String> aComponentsInGroup, String aGroupName) org.jdom2.Elementorg.jdom2.Elementorg.jdom2.ElementtoString()Name of the Componentorg.jdom2.ElementtoXML()writeVarInfos(String aFilePath) Writes the varInfos to a given FilePath.
-
Felddetails
-
iName
Name of component -
iVarMap
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 -
iSimModel
SimModel reference - can be seen as the thread the component is accessed in -
iSimComponentElement
protected org.jdom2.Element iSimComponentElementoriginal SimComponent configuration element (jdom) -
iOrderNumber
protected int iOrderNumberorder number for the serial order of the components -
iFrequence
frequence to check if component is executed or not -
iJexlRule
rule to check if component is executed or not -
isComponentGroup
protected final boolean isComponentGroupInfo about ComponentGroup -
iMasterComponentGroup
If component is part of a SimComponent Group Main Component mentioned here
-
-
Konstruktordetails
-
FWSimComponent
protected FWSimComponent()Main constructor for use with Class.forName()- Löst aus:
RuntimeException
-
FWSimComponent
protected FWSimComponent(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, int aOrderNumber) called via clone- Parameter:
aName-aFieldMap-aInputMap-aSimComponentElement-aVarMap-aOrderNumber-
-
-
Methodendetails
-
createSimComponent
public static FWSimComponent createSimComponent(org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, FWSimModel aSimModel, int aOrderNumber) throws SimLinkInvalidException factory method creating a SimComponent- Parameter:
aSimComponentElement-aVarMap-aSimModel-aOrderNumber-- Gibt zurück:
- newly created FWSimComponent
- Löst aus:
SimLinkInvalidException
-
createSimComponent
public static FWSimComponent createSimComponent(org.jdom2.Element aSimComponentElement, FWSimComponentGroup aComponentGroup, FWSimVarMap aVarMap, FWSimModel aSimModel, int aOrderNumber) throws SimLinkInvalidException factory method creating a SimComponent- Parameter:
aSimComponentElement-aComponentGroup-aVarMap-aSimModel-aOrderNumber-- Gibt zurück:
- newly created FWSimComponent
- Löst aus:
SimLinkInvalidException
-
createSimComponent
public static FWSimComponent createSimComponent(String tName, FWSimVarMap aVarMap, FWSimModel aSimModel, int aOrderNumber) throws SimLinkInvalidException - Parameter:
tName-aVarMap-aSimModel-aOrderNumber-- Gibt zurück:
- the created FWSimComponent
- Löst aus:
SimLinkInvalidException
-
createSimComponent
- Parameter:
aClassname-- Gibt zurück:
- the newly created sim component
-
getVariableField
- Parameter:
aKey-- Gibt zurück:
- the FWSimVariable from FieldMap (not from the VarMap!)
-
isVariableAvailable
- Parameter:
aString-- Gibt zurück:
- if Variable is available in VarMap
-
addVariable
Add Variable to the Filed map. This should be called in implementing classes within the method "createVariables".- Angegeben von:
addVariablein SchnittstelleFWSimFieldContainer- Parameter:
aVariable-
-
getVariable
- Angegeben von:
getVariablein SchnittstelleFWSimFieldContainer- Parameter:
aKey-- Gibt zurück:
- one SimVariable registered for given key
- Löst aus:
SimFieldMissingException- if Variable is Null
-
removeVariable
Remove variable from FieldMap - handle with care!- Angegeben von:
removeVariablein SchnittstelleFWSimFieldContainer- Parameter:
aID-- Siehe auch:
-
getName
- Angegeben von:
getNamein SchnittstelleFWSimFieldContainer- Gibt zurück:
- the name
-
getFieldMap
- Angegeben von:
getFieldMapin SchnittstelleFWSimFieldContainer- Gibt zurück:
- the name
-
getVarMap
- Angegeben von:
getVarMapin SchnittstelleFWSimFieldContainer- Gibt zurück:
- number in the order of Components
-
getFrequenceRuleScript
- Gibt zurück:
-
readInputs
- Parameter:
aSimComponentElement-- Gibt zurück:
- HashMap of inputs
-
writeVarInfos
Writes the varInfos to a given FilePath.- Parameter:
aFilePath-- Gibt zurück:
- the string result
-
bind
protected void bind()The model initialization function. Will be called only once, before running the model using process(). -
initialize
public void initialize()The model initialization function. Will be called only once, before running the model using process(). -
init
protected abstract void init()The model initialization function. Will be called only once, before running the model using process(). -
setVariablesDefault
protected void setVariablesDefault()The models writable variables like outputs, states and rates are set to default . -
createVariables
called only once when the SimComponent is created. Hereby the FieldMap is filled with the interfacing fields.- Angegeben von:
createVariablesin SchnittstelleFWSimFieldContainer- Gibt zurück:
- variables from the field map
- Siehe auch:
-
performLinks
links like given in the input part of the SimComponent configuration are performed. This is done only while model creation.- Löst aus:
SimLinkInvalidException
-
performLinks
- Parameter:
aLinkMap- with key = destination and value = source!- Löst aus:
SimLinkInvalidException
-
getInputs
- Gibt zurück:
- the map of the input relations. key is given without the name of the component.
-
reset
- Parameter:
aVarMap-
-
doProcess
protected void doProcess()The main model calculation function. Is guaranteed to be called once per module-specific time step. -
process
protected abstract void process()The main model calculation function. Is guaranteed to be called once per module-specific time step. -
clone
- Parameter:
aVarMap-- Gibt zurück:
- the deep clone of the SimComponent
-
getInputVariables
returns the input variables from FieldMap- Angegeben von:
getInputVariablesin SchnittstelleFWSimFieldContainer- Gibt zurück:
- FWSimVarables filtered - only input Variables
- Siehe auch:
-
getConstantVariables
- Gibt zurück:
- constant variables from the FieldMAp
-
getOutputVariables
- Angegeben von:
getOutputVariablesin SchnittstelleFWSimFieldContainer- Gibt zurück:
- the OutputVariables from the FieldMap
- Siehe auch:
-
toString
Name of the Component -
toDocXML
public org.jdom2.Element toDocXML()- Gibt zurück:
- Element of this document
- Siehe auch:
-
toXML
public org.jdom2.Element toXML()- Angegeben von:
toXMLin SchnittstelleFWSimFieldContainer- Gibt zurück:
- a xml element with all the settings of this component()
- Siehe auch:
-
toGroupXML
- Parameter:
aComponentsInGroup-aGroupName-- Gibt zurück:
- xml element which contains group of SimComponents
-
toResourcesDataXML
public org.jdom2.Element toResourcesDataXML()- Gibt zurück:
- xml element with all the info about constants of this component
-
toResourcesDefinitionXML
public org.jdom2.Element toResourcesDefinitionXML()- Gibt zurück:
- xml element which contains
section for this component for inclusion into solutions
-
toOutputDefinitionXML
public org.jdom2.Element toOutputDefinitionXML()- Gibt zurück:
- xml element which contains
-
toComponentLinkingXML
public org.jdom2.Element toComponentLinkingXML()- Gibt zurück:
- xml element which contains
section for this component for inclusion into solutions
-
getCreateFormXML
public final org.jdom2.Element getCreateFormXML()- Angegeben von:
getCreateFormXMLin SchnittstelleFWSimFieldContainer- Gibt zurück:
- a xml element with all the settings of this component()
- Siehe auch:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Angegeben von:
getEditFormXMLin SchnittstelleFWSimFieldContainer- Parameter:
aEnabled-- Gibt zurück:
- a xml element with all the settings of this component()
- Siehe auch:
-
getOrderNumber
public int getOrderNumber()- Angegeben von:
getOrderNumberin SchnittstelleFWSimFieldContainer- Gibt zurück:
- number in the order of Components
- Siehe auch:
-
getContentType
- Angegeben von:
getContentTypein SchnittstelleFWSimFieldContainer- Gibt zurück:
- number in the order of Components
- Siehe auch:
-
getFrequence
- Angegeben von:
getFrequencein SchnittstelleFWSimFieldContainer- Gibt zurück:
- the Frequence of the Container calling
- Siehe auch:
-
getMasterComponentGroup
- Gibt zurück:
- the master component if this is part of
FWSimComponentGroup
-
getDescription
- Gibt zurück:
- the description including title
-
runComponentTest
called for single component test to check the components algorithm.- Parameter:
aParamIndex- : Used to set up different test cases. Start with 0 - 1 aso- Siehe auch:
-
fillTestVariables
public abstract HashMap<String,FWSimVariable<?>> fillTestVariables(int aTestIndex, FWSimComponent.TEST_STATE aDefineOrCheck) called for single component test to check the components algorithm.- Parameter:
aDefineOrCheck- : Use TEST_STATE.DEFINE for defining the test default values and TEST_STATE.CHECK for the accepted resultsaParamIndex- : Used to set up different test cases. Start with 0 - 1 aso- Siehe auch:
-
checkCondition
Beschreibung aus Schnittstelle kopiert:FWSimFieldContainerCalled from inside the FWSimFieldContainer to log the initialization Errors.- Angegeben von:
checkConditionin SchnittstelleFWSimFieldContainer- Parameter:
aCheckResult-aMessage-
-
isConditionCheck
public boolean isConditionCheck()- Angegeben von:
isConditionCheckin SchnittstelleFWSimFieldContainer
-