Class FWSimCalibrationVariable<T>
java.lang.Object
net.simplace.sim.util.FWSimVariable<T>
net.simplace.sim.util.FWSimCalibrationVariable<T>
- Type Parameters:
T- data type of the variable value
A variable that is varied by a generator, e.g. for calibration or sensitivity analysis. It is defined by a
<cal> element whose <input> children (e.g. min, max,
count, values) are stored as additional variables named
<variable name>.<input id>. An input either has a constant value or references another
variable of the var map via its source attribute.- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from class FWSimVariable
FWSimVariable.CONTENT_TYPE, FWSimVariable.DATA_TYPE, FWSimVariable.DateFormatter, FWSimVariable.MODE_TYPE, FWSimVariable.VARIABLE_CATEGORY -
Field Summary
Fields inherited from class FWSimVariable
UNIT_SOLUTION_DEFINED -
Constructor Summary
ConstructorsConstructorDescriptionFWSimCalibrationVariable(FWSimVariable<T> aCreateSimVariable, org.jdom2.Element aVarElement, FWSimVarMap aVarMap) Creates a calibration variable from a plain variable and reads its inputs. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsProperty(String aPropertyName) static FWSimCalibrationVariable<?> createSimVariable(org.jdom2.Element aVarElement, FWSimFieldContainer aFWSimFieldContainer, FWSimVarMap aVarMap) Creates a calibration variable of the data type given in the XML element.HashMap<String, FWSimVariable<?>> getBooleanPropertyValue(String aPropertyName, FWSimVarMap aCurrentMap) getDoublePropertyValue(String aPropertyName, FWSimVarMap aCurrentMap) getIntegerPropertyValue(String aPropertyName, FWSimVarMap aCurrentMap) getProperty(String aPropertyName, FWSimVarMap aCurrentMap) Returns an input variable.getPropertyValue(String aPropertyName, FWSimVarMap aCurrentMap) getStringPropertyValue(String aPropertyName, FWSimVarMap aCurrentMap) voidreset()Clears the values of all inputs that are calculated by a rule, so that they are re-evaluated on the next access.Methods inherited from class FWSimVariable
addInputLink, addOutputLink, addPrefix, addValue, addValue, adoptUnitFrom, calculateValue, changeDefaultValue, check, clone, createFormElement, createFormFields, createFormFields, createMultipleFormElement, createOutputSimVariable, createSimVariable, createSimVariable, createSimVariable, deepClone, equals, evaluate, evaluate, fillMetaDataFromSource, forceBooleanValue, forceDoubleMapValue, forceDoubleValue, forceIntValue, forceStringValue, getArrayValue, getCategory, getContentType, getCount, getDataType, getDateFormatter, getDefault, getDescription, getFieldName, getFormat, getFormatter, getFormComponentXML, getInternalName, getMatrixValue, getMax, getMin, getModeType, getName, getOptions, getOrder, getPrefix, getRule, getRuleComplexity, getSource, getStringUnit, getStringValue, getUnit, getUnitSource, getValue, getVarMap, hasRule, isArray, isBoolean, isDate, isDouble, isInputContent, isInputLinked, isInt, isMeasData, isNumber, isOutputContent, isOutputLinked, isString, isUnitSolutionDefined, multiplyValue, removeLink, setArrayValue, setArrayValue, setContentType, setCount, setCount, setDefaultValue, setFormat, setModeType, setName, setNull, setRule, setSource, setUnitFrom, setValue, setValue, setValue, setValueAndDefault, setVarMap, toCalVarXML, toCalVarXML, toDebugString, toHTMLTablestring, toOutVarXML, toShortString, toString, toXML, transformContentType, transformDataType, transformDataType, transformDataTypeToDB, transformDBDataType, transformJavaDataType, transformJavaDataType, updateFields, updateFields
-
Constructor Details
-
FWSimCalibrationVariable
public FWSimCalibrationVariable(FWSimVariable<T> aCreateSimVariable, org.jdom2.Element aVarElement, FWSimVarMap aVarMap) Creates a calibration variable from a plain variable and reads its inputs. The inputscountandvaluesalso set the count of aCreateSimVariable.- Parameters:
aCreateSimVariable- variable created from the<cal>element; provides meta data and valueaVarElement- the<cal>element with its<input>childrenaVarMap- var map used to resolve inputs with asourceattribute
-
-
Method Details
-
createSimVariable
public static FWSimCalibrationVariable<?> createSimVariable(org.jdom2.Element aVarElement, FWSimFieldContainer aFWSimFieldContainer, FWSimVarMap aVarMap) Creates a calibration variable of the data type given in the XML element.- Parameters:
aVarElement- the<cal>element with its<input>childrenaFWSimFieldContainer- the component (e.g. the generator) the variable belongs toaVarMap- var map used to resolve inputs with asourceattribute- Returns:
- the new calibration variable
- Throws:
RuntimeException- if the value does not match the data type
-
createVariables
- Returns:
- a new map with all input variables and this variable, keyed by name
-
reset
public void reset()Clears the values of all inputs that are calculated by a rule, so that they are re-evaluated on the next access.- Overrides:
resetin classFWSimVariable<T>
-
containsProperty
- Parameters:
aPropertyName- input id, e.g.min- Returns:
trueif the calibration has an input with this id
-
getProperty
Returns an input variable. If the input is calculated by a rule and has no value yet, the rule is evaluated against the given var map first.- Parameters:
aPropertyName- input id, e.g.minaCurrentMap- var map used to evaluate rules- Returns:
- the input variable
-
getPropertyValue
- Parameters:
aPropertyName- input idaCurrentMap- var map used to evaluate rules- Returns:
- the value of the input
- See Also:
-
getDoublePropertyValue
- Parameters:
aPropertyName- input idaCurrentMap- var map used to evaluate rules- Returns:
- the value of the input converted to Double
- See Also:
-
getIntegerPropertyValue
- Parameters:
aPropertyName- input idaCurrentMap- var map used to evaluate rules- Returns:
- the value of the input converted to Integer
- See Also:
-
getBooleanPropertyValue
- Parameters:
aPropertyName- input idaCurrentMap- var map used to evaluate rules- Returns:
- the value of the input converted to Boolean (
falseif it cannot be converted) - See Also:
-
getStringPropertyValue
- Parameters:
aPropertyName- input idaCurrentMap- var map used to evaluate rules- Returns:
- the value of the input converted to String
- See Also:
-