Package net.simplace.sim.util
Klasse FWSimVarMap
java.lang.Object
net.simplace.sim.util.FWSimVarMap
- Alle implementierten Schnittstellen:
org.apache.commons.jexl3.JexlContext
Each parameter has a "string" name
Value is given as implemented member of Variable
Variable has last changed date instance, creator reference and value
Has a general simulation (model run) and project (project run) id
Implements a HashMap Ungültige Eingabe: "<"String, Object>
Has replacement method for parameter tokens
Linking Variables can hereby be checked for:
Unit, DataType and ContentType
Setting Value can be checked for
DataType, Source of Data, Min/Max
Debugging can be done using
Description, Unit, Date last changed (same day yesterday, ), Source of value
- Autor:
- Andreas Enders
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.apache.commons.jexl3.JexlContext
org.apache.commons.jexl3.JexlContext.AnnotationProcessor, org.apache.commons.jexl3.JexlContext.CancellationHandle, org.apache.commons.jexl3.JexlContext.ClassNameResolver, org.apache.commons.jexl3.JexlContext.ModuleProcessor, org.apache.commons.jexl3.JexlContext.NamespaceFunctor, org.apache.commons.jexl3.JexlContext.NamespaceResolver, org.apache.commons.jexl3.JexlContext.OptionsHandle, org.apache.commons.jexl3.JexlContext.PragmaProcessor, org.apache.commons.jexl3.JexlContext.ThreadLocal -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringsignifying the string used as id for the current day of monthstatic final Stringsignifying the string used as id for the current day of yearstatic final Stringsignifying the string used as id for the current month in the VarMapstatic final Stringsignifying the string used as id for the current year in the VarMapstatic final DateTimeFormatterParser for operations to be calculatedstatic final Stringsignifying the string used as id for the end date in the VarMapstatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringprojectlines that are read from project filestatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringsignifying the string used as id for the current date in the VarMapstatic final Stringsignifying whether date has to be reset after spinupstatic final Stringsignifying the integer number of spin up days in the VarMapstatic final Stringsignifying whether date has to be reset after spinupstatic final Stringsignifying whether date was reset after spinupstatic final Stringsignifying the string used as id for the end date in the VarMapstatic final Stringsignifying whether threads are synchronized within one project (true) or not (false)static final Stringthe rule for the data synchronized within one project if FREQUENCE is COMPLEX -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungFor documentation reasonsFWSimVarMap(HashMap<String, FWSimVariable<?>> aParameterMap) FWSimVarMap(HashMap<String, FWSimVariable<?>> aFormInputParameterMap, FWSimModel aModel, String aProjectID, FWSimSession aCurrentSession) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddLink(String aKey, FWSimVariable<?> aVar, boolean performChecks) Link between 2 SimVariables is added.voidaddVariable(String aKey, FWSimVariable<?> aFWSimVariable, boolean isLink) new SimVariable is initialized and put to simVarMapvoidcalculates statisticsbooleancheckInternal(FWSimVariable<?> aFwSimVariable) clone(FWSimSession aSession) deep clone on the SimVarMap - no references will stay same!deep clone on the SimVarMap - no references will stay same!booleanObject[]filterData(HashMap<String, FWSimVariable<?>> aFilterMap) filters data from the map and returns it as Object[]Object[]filterData(Set<String> aKeySet) filters data from the map and returns it as Object[]booleanforceBooleanValue(String aParamKey) used if generic type of the SimVariable is different but convertable to boolean. otherwise use getValue()!forceDateValue(String aParamKey) used if generic type of the SimVariable is different but convertable to date. otherwise use getValue()!Double[]forceDoubleArrayValue(String aString) used if generic type of the SimVariable is different but convertible to double array. otherwise use getValue()!forceDoubleMapValue(String aKey) used if generic type of the SimVariable is different but convertible to Double Map from array. otherwise use getValue()!forceDoubleValue(String aKey) Integer[]forceIntegerArrayValue(String aString) used if generic type of the SimVariable is different but convertible to integer array. otherwise use getValue()!forceIntegerValue(String aKey) Returns the number of observers of this Observable object.Decorates the class as MapContextcalculates statisticsintintintintReturns the number of observers of this Observable object.getSimVariable(String aKey) getStringValue(String aKey) getValueToDatabaseString(String aSourceKey) mainly used for Date, DoubleArray and IntArray to get String format of the valuesgetVariables(FWSimFieldContainer aContainer) Set<FWSimVariable<?>> getVariables(FWSimVariable.CONTENT_TYPE aContentType) booleanDecorates the class as MapContextbooleanhasSimVariable(String aRule) voidInitializes the Current Date of the VarMapvoidinitValue(String aKey, FWSimVariable<?> aFWSimVariable) new SimVariable is initialized and put to simVarMapstatic booleanisInternal(String aVarName) booleanbooleanbooleanisVariableAvailable(String aKey) booleanvoidputAllVariables(Map<String, FWSimVariable<?>> aVarMap) number of variables are added to the VarMapvoidremoveLink(String aName, FWSimVariable<?> aFwSimVariable) voidremoveVariable(String aElement) use with care!replaceParamTokens(String aString, Object aDefault) Replacement of parameters in a string is performed.voidreset()set all variables to default valuesvoidDecorates the class as MapContextvoidsetCurrentDate(LocalDateTime aCurrentDate) voidsetCurrentSession(FWSimSession aFwSimSession) voidsetProjectID(String aProjectID) voidsetSessionID(String aSessionID) voidsets the simulation endvoidsetSimulationName(String aSimulationName) voidsetSimulationNumber(Integer aSimulationNumber) voidsetValue(String aKey, Object aValue, FWSimVariable.DATA_TYPE aDataType, FWSimVariable.CONTENT_TYPE aContentType, FWSimFieldContainer aSourceComponent) sets the value to the FWSimVariable.voidsetWaiting(boolean shouldWait) String[][]toArray()toString()simple output of VarMapvoidused to set the current model date to the VarMap
-
Felddetails
-
CURRENT_DATE
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
CURRENT_YEAR
signifying the string used as id for the current year in the VarMap- Siehe auch:
-
CURRENT_DAY
signifying the string used as id for the current day of month- Siehe auch:
-
CURRENT_MONTH
signifying the string used as id for the current month in the VarMap- Siehe auch:
-
CURRENT_DOY
signifying the string used as id for the current day of year- Siehe auch:
-
PROJECT_ID
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
PROJECT_ITERATION
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
SIMULATION_ID
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
SIMULATION_NAME
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
SIMULATION_NUMBER
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
SESSION_ID
signifying the string used as id for the current date in the VarMap- Siehe auch:
-
SPINUP_DAYS
signifying the integer number of spin up days in the VarMap- Siehe auch:
-
SPINUP_DO_RESET
signifying whether date has to be reset after spinup- Siehe auch:
-
SPINUP_RESET
signifying whether date was reset after spinup- Siehe auch:
-
SYNCHRONIZE_FREQUENCE
signifying whether threads are synchronized within one project (true) or not (false)- Siehe auch:
-
SYNCHRONIZE_RULE
the rule for the data synchronized within one project if FREQUENCE is COMPLEX- Siehe auch:
-
PROJECT_LINES
projectlines that are read from project file- Siehe auch:
-
SIMULATIONS_SELECTED
signifying whether date has to be reset after spinup- Siehe auch:
-
END_DATE
signifying the string used as id for the end date in the VarMap- Siehe auch:
-
START_DATE
signifying the string used as id for the end date in the VarMap- Siehe auch:
-
DATE_FORMAT
Parser for operations to be calculated
-
-
Konstruktordetails
-
FWSimVarMap
public FWSimVarMap(HashMap<String, FWSimVariable<?>> aFormInputParameterMap, FWSimModel aModel, String aProjectID, FWSimSession aCurrentSession) - Parameter:
aFormInputParameterMap-aModel-aProjectID-aCurrentSession-
-
FWSimVarMap
- Parameter:
aParameterMap-
-
FWSimVarMap
public FWSimVarMap()For documentation reasons
-
-
Methodendetails
-
setWaiting
- Löst aus:
InterruptedException
-
getVarMap
- Gibt zurück:
- the parameterMap
-
getStringValue
- Parameter:
aKey-- Gibt zurück:
- one parameter value for given key - null if key was not set
-
forceIntegerValue
- Parameter:
aKey-- Gibt zurück:
- one parameter converted to Integer value for given key - null if key was not set or value not convertible
-
forceDoubleValue
- Parameter:
aKey-- Gibt zurück:
- one parameter converted to Double value for given key - null if key was not set or value not convertible
-
forceBooleanValue
used if generic type of the SimVariable is different but convertable to boolean. otherwise use getValue()!- Parameter:
aParamKey-- Gibt zurück:
- boolean value to be forced from other data type
-
forceDateValue
used if generic type of the SimVariable is different but convertable to date. otherwise use getValue()!- Parameter:
aParamKey-- Gibt zurück:
- the date that was retrieved from convert.
-
forceDoubleArrayValue
used if generic type of the SimVariable is different but convertible to double array. otherwise use getValue()!- Parameter:
aString-- Gibt zurück:
- the converted value
-
forceDoubleMapValue
used if generic type of the SimVariable is different but convertible to Double Map from array. otherwise use getValue()!- Parameter:
aKey-- Gibt zurück:
- the converted value
-
forceIntegerArrayValue
used if generic type of the SimVariable is different but convertible to integer array. otherwise use getValue()!- Parameter:
aString-- Gibt zurück:
- the converted value
-
replaceParamTokens
Replacement of parameters in a string is performed.- Parameter:
aString-aDefault-- Gibt zurück:
- the new String after replacement of the different variable tags
- Siehe auch:
-
getValue
- Parameter:
aKey-- Gibt zurück:
- object value of the FWSimVariable registered with key
-
getValue
- Parameter:
aKey-aDefault-- Gibt zurück:
- object value of the FWSimVariable registered with key
-
setValue
public void setValue(String aKey, Object aValue, FWSimVariable.DATA_TYPE aDataType, FWSimVariable.CONTENT_TYPE aContentType, FWSimFieldContainer aSourceComponent) throws SimValueOutOfRangeException sets the value to the FWSimVariable. If Max or Min rule is not successfully evaluated SimValueOutOfRangeException is thrown. It is typeof RuntimeException and need not to be handled If FWSimVariable is not existing it will be created with a warn Message in log.- Parameter:
aKey-aValue-aDataType-aContentType-aSourceComponent-- Löst aus:
SimValueOutOfRangeException
-
initValue
new SimVariable is initialized and put to simVarMap- Parameter:
aKey-aFWSimVariable-
-
addVariable
new SimVariable is initialized and put to simVarMap- Parameter:
aKey-aFWSimVariable-isLink-
-
getProjectID
- Gibt zurück:
- Identifier of this Functionality
-
getSimulationID
Returns the number of observers of this Observable object.- Gibt zurück:
- the number of observers of this object.
-
generateSimulationID
Returns the number of observers of this Observable object.- Gibt zurück:
- the number of observers of this object.
-
setSimulationName
- Parameter:
aSimulationName-
-
getSimulationName
- Gibt zurück:
- simulation name
-
getSimulationNumber
- Gibt zurück:
- the simulation number
-
getIteration
- Gibt zurück:
- the iteration number
-
getCurrentSession
- Gibt zurück:
- the current session
-
isSynchronized
public boolean isSynchronized()- Gibt zurück:
- if session is synchronized
-
getSynchronizedFrequence
- Gibt zurück:
- if session is synchronized
-
getSynchronizeRule
- Gibt zurück:
-
isWaiting
public boolean isWaiting()- Gibt zurück:
-
getCurrentDateString
calculates statistics- Gibt zurück:
- Current model date toFormated string
-
getStartDate
- Gibt zurück:
- Start Date Variable
-
getEndDate
- Gibt zurück:
- End Date Variable
-
calculateStatistics
public void calculateStatistics()calculates statistics -
setProjectID
- Parameter:
aProjectID-
-
setSessionID
- Parameter:
aSessionID-
-
setSimulationNumber
- Parameter:
aSimulationNumber-
-
setCurrentSession
- Parameter:
aFwSimSession-
-
removeVariable
use with care! Variable might be needed- Parameter:
aElement-
-
filterData
filters data from the map and returns it as Object[]- Parameter:
aFilterMap-- Gibt zurück:
-
filterData
filters data from the map and returns it as Object[]- Parameter:
aKeySet-- Gibt zurück:
-
putAllVariables
number of variables are added to the VarMap- Parameter:
aVarMap-
-
isVariableAvailable
- Parameter:
aKey-- Gibt zurück:
- s if a SimVariable is available
-
isSpinupPeriode
public boolean isSpinupPeriode()- Gibt zurück:
- s if system is in spin up period
-
doSpinupReset
public boolean doSpinupReset()- Gibt zurück:
-
toString
simple output of VarMap -
toArray
- Gibt zurück:
- Key, SimVarName and Value as Array
-
addLink
public void addLink(String aKey, FWSimVariable<?> aVar, boolean performChecks) throws SimLinkInvalidException Link between 2 SimVariables is added. If Link cannot be established a SimLinkInvalidException is thrown- Parameter:
aKey- of the target part of the linkaVar- with the source part of the linkperformChecks-- Löst aus:
SimLinkInvalidException
-
removeLink
- Parameter:
aName-aFwSimVariable-
-
initializeCurrentDate
Initializes the Current Date of the VarMap- Parameter:
aDate-
-
updateCurrentDate
public void updateCurrentDate()used to set the current model date to the VarMap -
getCurrentDate
- Gibt zurück:
- the current model date
-
setCurrentDate
- Parameter:
aCurrentDate- the current model date
-
getCurrentDOY
public int getCurrentDOY()- Gibt zurück:
- current DayOfYear
-
getCurrentYear
public int getCurrentYear()- Gibt zurück:
- current Year
-
getCurrentDayOfMonth
public int getCurrentDayOfMonth()- Gibt zurück:
- current Day of Month
-
getCurrentMonth
public int getCurrentMonth()- Gibt zurück:
- current Month
-
hasSimulationEnded
- Gibt zurück:
- the simulationEnd
-
setSimulationEnd
public void setSimulationEnd()sets the simulation end -
clone
deep clone on the SimVarMap - no references will stay same!- Parameter:
aSession-- Gibt zurück:
- Siehe auch:
-
cloneToControlMap
deep clone on the SimVarMap - no references will stay same!- Gibt zurück:
- Siehe auch:
-
getSimLinks
- Gibt zurück:
- a MultiHashMap containing all Links
-
reset
public void reset()set all variables to default values -
hasSimVariable
- Parameter:
aRule-- Gibt zurück:
- if the registered FWSimVariable is available for the given key!
-
getSimVariable
- Parameter:
aKey-- Gibt zurück:
- the registered FWSimVariable - need not be the one with the given key!
- Löst aus:
SimFieldMissingException
-
getValueToDatabaseString
mainly used for Date, DoubleArray and IntArray to get String format of the values- Parameter:
aSourceKey-- Gibt zurück:
- the value as converted database string
- Löst aus:
SimFieldMissingException
-
getVariables
- Parameter:
aContentType-- Gibt zurück:
- a list of Variables having this content type
-
getVariables
public MultiHashMap<FWSimVariable.CONTENT_TYPE,FWSimVariable<?>> getVariables(FWSimFieldContainer aContainer) - Parameter:
aContainer-aContentType-- Gibt zurück:
- a list of Variables having this source container
-
has
Decorates the class as MapContext- Angegeben von:
hasin Schnittstelleorg.apache.commons.jexl3.JexlContext- Siehe auch:
-
get
Decorates the class as MapContext- Angegeben von:
getin Schnittstelleorg.apache.commons.jexl3.JexlContext- Siehe auch:
-
set
Decorates the class as MapContext- Angegeben von:
setin Schnittstelleorg.apache.commons.jexl3.JexlContext- Siehe auch:
-
isInternal
-
checkInternal
-