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
public class FWSimVarMap implements org.apache.commons.jexl2.JexlContext {
// Public Constructors
public FWSimVarMap(HashMap aFormInputParameterMap, FWSimModel aModel, String
aProjectID, FWSimSession aCurrentSession);
public FWSimVarMap(HashMap aParameterMap);
// Constants
public static final String CURRENT_DATE;
public static final String CURRENT_YEAR;
public static final String CURRENT_DAY;
public static final String CURRENT_MONTH;
public static final String CURRENT_DOY;
public static final String PROJECT_ID;
public static final String SIMULATION_ID;
public static final String SIMULATION_NAME;
public static final String SIMULATION_NUMBER;
public static final String SESSION_ID;
public static final String SPINUP_DAYS;
public static final String SPINUP_RESET;
public static final DateTimeFormatter DATE_FORMAT;
// Public Instance Methods public HashMap getVarMap();
returns the parameterMap
public String
getStringValue(String aKey);
returns one parameter value for given key - null if key was not set
public Integer
forceIntegerValue(String aKey);
returns one parameter converted to Integer value for given key - null if
key was not set or value not convertible
public Double
forceDoubleValue(String aKey);
returns one parameter converted to Double value for given key - null if
key was not set or value not convertible
public boolean
forceBooleanValue(String aParamKey);
used if generic type of the SimVariable is different but convertable to
boolean. otherwise use
getValue()!
returns boolean value to be forced from other data type
public LocalDateTime
forceDateValue(String aParamKey);
used if generic type of the SimVariable is different but convertable to
date. otherwise use
getValue()!
returns the date that was retrieved from convert.
public Double[]
forceDoubleArrayValue(String aString);
used if generic type of the SimVariable is different but convertible to
double array. otherwise use
getValue()!
returns the converted value
public TreeMap
forceDoubleMapValue(String aKey);
used if generic type of the SimVariable is different but convertible to
Double Map from array. otherwise use
getValue()!
returns the converted value
public Integer[]
forceIntegerArrayValue(String aString);
used if generic type of the SimVariable is different but convertible to
integer array. otherwise use
getValue()!
returns the converted value
public String
replaceParamTokens(String aString, Object aDefault);
Replacement of parameters in a string is performed.
returns the new String after replacement of the different variable tags
public Object
getValue(String aKey);
returns object value of the FWSimVariable registered with key
public Object
getValue(String aKey, Object aDefault);
returns object value of the FWSimVariable registered with key
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.
- aKey
- aValue
- aDataType
- aContentType
- aSourceComponent
public void
initValue(String aKey,
FWSimVariable aFWSimVariable);
new SimVariable is initialized and put to simVarMap
public String getProjectID();
returns Identifier of this Functionality
public String getSimulationID();
Returns the number of observers of this Observable object.
returns the number of observers of this object.
public void
setSimulationName(String aSimulationName);
public String getSimulationName();
returns simulation name
public Integer getSimulationNumber();
returns the simulation number
public
FWSimSession getCurrentSession();
returns the current session
public String getCurrentDateString();
calculates statistics
returns Current model date toFormated string
public void calculateStatistics();
calculates statistics
public void
setProjectID(String aProjectID);
public void
setSimulationNumber(Integer aSimulationNumber);
public void
removeVariable(String aElement);
use with care! Variable might be needed
public void
putAllVariables(Map aVarMap);
number of variables are added to the VarMap
public boolean
isVariableAvailable(String aKey);
returns s if a SimVariable is available
public boolean isSpinupPeriode();
returns s if system is in spin up period
public String toString(); // Overrides java.lang.Object
simple output of VarMap
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
- aKey of the target part of the link
- aVar with the source part of the link
- performChecks
public void
removeLink(String aName,
FWSimVariable aFwSimVariable);
public void
initializeCurrentDate(LocalDateTime aDate);
Initializes the Current Date of the VarMap
public void updateCurrentDate();
used to set the current model date to the VarMap
public LocalDateTime getCurrentDate();
returns the current model date
public void
setCurrentDate(LocalDateTime aCurrentDate);
- aCurrentDate the current model date
public int getCurrentDOY();
returns current DayOfYear
public int getCurrentYear();
returns current Year
public int getCurrentDayOfMonth();
returns current Day of Month
public int getCurrentMonth();
returns current Month
public Boolean hasSimulationEnded();
returns the simulationEnd
public void setSimulationEnd();
sets the simulation end
public
FWSimVarMap clone();
// Overrides java.lang.Object
deep clone on the SimVarMap - no references will stay same!
public HashMap getSimLinks();
returns a MultiHashMap containing all Links
public void reset();
set all variables to default values
public boolean
hasSimVariable(String aRule);
returns if the registered FWSimVariable is available for the given key!
public String
getValueToDatabaseString(String aSourceKey)
throws
SimFieldMissingException;
mainly used for Date, DoubleArray and IntArray to get String format of the values
returns the value as converted database string
public boolean has(String aName); // From
org.apache.commons.jexl2.JexlContext
Decorates the class as MapContext
public Object get(String aName); // From
org.apache.commons.jexl2.JexlContext
Decorates the class as MapContext
public void set(String aName, Object aValue); // From
org.apache.commons.jexl2.JexlContext
Decorates the class as MapContext
}
Passed to: net.simplace.simulation.io.output.FWSimOutputManager.addOutput(), net.simplace.simulation.io.output.adapter.CacheOutputAdapter(), net.simplace.simulation.io.output.FWSimOutputManager.calculateStatistics(), net.simplace.simulation.model.FWSimpleSimComponent.clone(), net.simplace.simulation.model.FWSimModel.clone(), net.simplace.simulation.model.FWSimComponent.clone(), net.simplace.simulation.model.DefaultManagement.clone(), FWSimVariable.clone(), net.simplace.simulation.io.output.FWSimOutputAdapter.createAdapter(), net.simplace.simulation.model.FWSimComponent.createSimComponent(), net.simplace.simulation.model.FWSimComponent.createSimComponent(), net.simplace.simulation.io.output.adapter.CSVOutputAdapter(), net.simplace.simulation.io.output.adapter.DatabaseOutputAdapter(), net.simplace.simulation.wrapper.SimplaceWrapper.DataContainer(), net.simplace.simulation.wrapper.SimplaceWrapper.DataContainer(), net.simplace.simulation.model.DefaultManagement(), FWSimVariable.evaluate(), net.simplace.simulation.control.FWSimulationGenerator.evaluate(), FWSimVariable.fillMetaDataFromSource(), net.simplace.simulation.io.resources.FWSimResourceTransformer.fillVarMap(), net.simplace.simulation.io.resources.transformer.DefaultSQLStatementTransformer.fillVarMap(), net.simplace.simulation.io.resources.transformer.DefaultRuleTransformer.fillVarMap(), net.simplace.simulation.io.resources.FWSimResourceCache.fillVarMapFromCache(), net.simplace.simulation.io.resources.FWSimResourceCache.fillVarMapFromDatabase(), net.simplace.simulation.io.output.FWSimOutputManager.finishSimulationOutputs(), net.simplace.simulation.io.output.FWSimCalibrationOutput(), net.simplace.simulation.model.FWSimComponent(), net.simplace.simulation.model.FWSimComponentGroup(), net.simplace.simulation.model.FWSimModel(), net.simplace.simulation.io.output.FWSimOutput(), net.simplace.simulation.io.output.FWSimOutput(), net.simplace.simulation.io.output.FWSimOutputAdapter(), net.simplace.simulation.event.FWSimOutputEvent(), net.simplace.simulation.model.FWSimpleSimComponent(), net.simplace.simulation.model.FWSimpleSimComponent(), net.simplace.simulation.FWSimSession(), net.simplace.simulation.FWSimSimulation(), net.simplace.simulation.FWSimSolution(), net.simplace.simulation.io.resources.FWSimInputAdapter.getData(), net.simplace.simulation.io.resources.adapter.XMLResourceAdapter.getData(), net.simplace.simulation.io.resources.adapter.DatabaseResourceAdapter.getData(), net.simplace.simulation.io.resources.adapter.CSVResourceAdapter.getData(), net.simplace.simulation.io.resources.transformer.DefaultSQLStatementTransformer.getData(), net.simplace.simulation.io.resources.transformer.DefaultRuleTransformer.getData(), net.simplace.simulation.io.resources.adapter.XMLResourceAdapter.getData(), net.simplace.simulation.io.resources.adapter.CSVResourceAdapter.getData(), net.simplace.simulation.io.FilePoolManager.getFile(), net.simplace.simulation.io.interfaces.MEMORYInterface.getInterface(), net.simplace.simulation.io.interfaces.FWSimInterface.getInterface(), net.simplace.simulation.io.interfaces.FILEInterface.getInterface(), net.simplace.simulation.io.interfaces.DatabaseInterface.getInterface(), net.simplace.simulation.io.interfaces.CSVInterface.getInterface(), FWSimHelper.getObjectArrayFromVarMap(), net.simplace.simulation.io.resources.adapter.DatabaseResourceAdapter.getResultSet(), net.simplace.simulation.io.resources.transformer.DefaultSQLStatementTransformer.getResultSet(), net.simplace.simulation.io.resources.FWSimResourceTransformer.getSourceResourceCache(), FWSimHelper.getValueFromSpecialParameter(), net.simplace.simulation.io.output.FWSimOutputAdapter.init(), net.simplace.simulation.io.output.adapter.DatabaseOutputAdapter.init(), net.simplace.simulation.io.output.adapter.CSVOutputAdapter.init(), net.simplace.simulation.io.output.adapter.CacheOutputAdapter.init(), net.simplace.simulation.io.output.FWSimOutputAdapter.initialize(), net.simplace.simulation.io.output.FWSimOutput.initialize(), net.simplace.simulation.model.FWSimVarLink.initialize(), net.simplace.simulation.io.output.FWSimOutputManager.initializeOutputs(), net.simplace.simulation.FWSimSession.initProjects(), net.simplace.simulation.io.output.FWSimOutput.OUTPUT(), net.simplace.simulation.io.output.FWSimOutputManager.OUTPUT(), net.simplace.simulation.FWSimEngine.prepareSession(), net.simplace.simulation.io.FilePool.registerFile(), net.simplace.simulation.io.output.FWSimOutput.removeSimulationCache(), FWSimHelper.replaceParamTokens(), net.simplace.simulation.model.FWSimModel.reset(), net.simplace.simulation.model.FWSimComponent.reset(), FWSimVariable.setVarMap(), net.simplace.simulation.io.resources.FWSimResourceCache.shouldUpdate(), net.simplace.simulation.io.output.FWSimOutput.updateAdapter(), net.simplace.simulation.io.output.FWSimOutputManager.updateAdapter(), net.simplace.simulation.io.output.adapter.CSVOutputAdapter.updateFile(), net.simplace.simulation.io.output.FWSimOutputManager.updateInterface(), net.simplace.simulation.io.resources.FWSimResourceManager.updateInterface(), net.simplace.simulation.io.resources.FWSimResourceManager.updateResources(), net.simplace.simulation.io.resources.FWSimResourceManager.updateVarMap()
Returned by: net.simplace.simulation.model.FWSimModel.call(), clone(), net.simplace.simulation.FWSimSimulation.getVarMap(), net.simplace.simulation.event.FWSimOutputEvent.getVarMap(), net.simplace.simulation.model.FWSimModel.getVarMap(), FWSimVariable.getVarMap()
Type of: net.simplace.simulation.control.FWSimulationSelector.iVarMap, net.simplace.simulation.control.FWSimulationGenerator.iVarMap, net.simplace.simulation.model.FWSimComponent.iVarMap