Class FWAnalyticsSimComponent
java.lang.Object
net.simplace.sim.model.FWSimComponent
net.simplace.sim.components.FWAnalyticsSimComponent
- All Implemented Interfaces:
FWSimFieldContainer
Component that outputs the runtime statistics (process times) of the other components, e.g. to find slow
components. The
process child defines INT variables named like the components (the mode selects SUM,
AVG, MAX or COUNT), optionally an INT array for all values and a CHAR array for their names; without variables all
known process times are output. Creating the component switches on the process time measurement; by default the
times are reset after each step (cDoReset).- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from class FWSimComponent
FWSimComponent.TEST_STATE -
Field Summary
Fields inherited from class FWSimComponent
iFieldMap, iFrequence, iInputMap, iJexlRule, iMasterComponentGroup, iName, iOrderNumber, iResetWhenInactive, isComponentGroup, iSimComponentElement, iSimModel, iVarMap -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for instantiation via reflection.FWAnalyticsSimComponent(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, int aOrderNumber) FWAnalyticsSimComponent(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, LinkedList<FWSimVariable<Integer>> aProcessAlgorithmsMap, FWSimVariable<String[]> aHeader, FWSimVariable<Integer[]> aValues, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, int aOrderNumber) Constructor used byclone(FWSimVarMap). -
Method Summary
Modifier and TypeMethodDescriptionprotected FWSimComponentclone(FWSimVarMap aVarMap) Clones the component for a simulation.HashMap<String, FWSimVariable<?>> CreatescDoResetand the output variables of theprocesschild (or one per known process time; also without aprocesselement, which is logged as error), and switches on the process time measurement.HashMap<String, FWSimVariable<?>> fillTestVariables(int aParamIndex, FWSimComponent.TEST_STATE aDefineOrCheck) No component tests for this component.protected voidinit()Replaces the output variables by the instances of the variable map of the simulation.protected voidprocess()Sets the outputs from the process times (aggregated by the mode of each variable) and resets the process times ifcDoResetis true.org.jdom2.ElementtoXML()Creates thesimcomponentelement with the process time variables (not the arrays).Methods inherited from class FWSimComponent
addVariable, bind, checkCondition, createSimComponent, createSimComponent, createSimComponent, createSimComponent, doProcess, getConstantVariables, getContentType, getCreateFormXML, getDescription, getEditFormXML, getFieldMap, getFrequence, getFrequenceRuleScript, getInputs, getInputValueText, getInputVariables, getMasterComponentGroup, getName, getOrderNumber, getOutputVariables, getSimComponentElement, getVariable, getVariableField, getVarMap, initialize, isConditionCheck, isVariableAvailable, performLinks, performLinks, readInputs, removeVariable, reset, runComponentTest, setInputValue, setVariablesDefault, syncInputLinks, toComponentLinkingXML, toDocXML, toGroupXML, toOutputDefinitionXML, toResourcesDataXML, toResourcesDefinitionXML, toString, writeVarInfos
-
Constructor Details
-
FWAnalyticsSimComponent
public FWAnalyticsSimComponent(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, int aOrderNumber) - Parameters:
aName- name of the componentaFieldMap- variables of the componentaInputMap- input links of the componentaSimComponentElement- thesimcomponentelementaVarMap- variable map of the simulationaOrderNumber- order number of the component
-
FWAnalyticsSimComponent
public FWAnalyticsSimComponent()Constructor for instantiation via reflection. -
FWAnalyticsSimComponent
public FWAnalyticsSimComponent(String aName, HashMap<String, FWSimVariable<?>> aFieldMap, LinkedList<FWSimVariable<Integer>> aProcessAlgorithmsMap, FWSimVariable<String[]> aHeader, FWSimVariable<Integer[]> aValues, HashMap<String, String> aInputMap, org.jdom2.Element aSimComponentElement, FWSimVarMap aVarMap, int aOrderNumber) Constructor used byclone(FWSimVarMap).- Parameters:
aName- name of the componentaFieldMap- variables of the componentaProcessAlgorithmsMap- output variables, one per process timeaHeader- output array with the names, may benullaValues- output array with the values, may benullaInputMap- input links of the componentaSimComponentElement- thesimcomponentelementaVarMap- variable map of the simulationaOrderNumber- order number of the component
-
-
Method Details
-
createVariables
CreatescDoResetand the output variables of theprocesschild (or one per known process time; also without aprocesselement, which is logged as error), and switches on the process time measurement. Note:FWConstants.PROCESS_TIMEis a global switch; it stays on for all following simulations in this JVM.- Specified by:
createVariablesin interfaceFWSimFieldContainer- Specified by:
createVariablesin classFWSimComponent- Returns:
- the field map, or
nullwithout component element - See Also:
-
init
protected void init()Replaces the output variables by the instances of the variable map of the simulation.- Specified by:
initin classFWSimComponent- See Also:
-
process
protected void process()Sets the outputs from the process times (aggregated by the mode of each variable) and resets the process times ifcDoResetis true.- Specified by:
processin classFWSimComponent- See Also:
-
toXML
public org.jdom2.Element toXML()Creates thesimcomponentelement with the process time variables (not the arrays).- Specified by:
toXMLin interfaceFWSimFieldContainer- Overrides:
toXMLin classFWSimComponent- Returns:
- an XML element with all settings of this container
- See Also:
-
fillTestVariables
public HashMap<String, FWSimVariable<?>> fillTestVariables(int aParamIndex, FWSimComponent.TEST_STATE aDefineOrCheck) No component tests for this component.- Specified by:
fillTestVariablesin classFWSimComponent- Parameters:
aParamIndex- index of the test case (not used)aDefineOrCheck- define or check phase (not used)- Returns:
- always
null - See Also:
-
clone
Clones the component for a simulation.- Specified by:
clonein classFWSimComponent- Parameters:
aVarMap- var map of the new simulation- Returns:
- the new instance
- See Also:
-