net.simplace.sim.util.FWSimVarMap

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 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.jexl3.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 PROJECT_ITERATION;
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 String SYNCHRONIZE_FREQUENCE;
public static final String SYNCHRONIZE_RULE;
public static final String PROJECT_LINES;
public static final String SIMULATIONS_SELECTED;
public static final DateTimeFormatter DATE_FORMAT;

// Class Methods
public static boolean isInternal(String aVarName);


// Public Instance Methods
public void setWaiting(boolean shouldWait) throws InterruptedException;

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.
public void initValue(String aKey, FWSimVariable aFWSimVariable);

new SimVariable is initialized and put to simVarMap
public void addVariable(String aKey, FWSimVariable aFWSimVariable, boolean
isLink);

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 String generateSimulationID();

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 Integer getIteration();


returns the iteration number
public FWSimSession getCurrentSession();


returns the current session
public boolean isSynchronized();


returns if session is synchronized
public FWSimIOAdapter.FREQUENCE getSynchronizedFrequence();


returns if session is synchronized
public String getSynchronizeRule();


returns
public boolean isWaiting();


returns
public String getCurrentDateString();

calculates statistics
returns Current model date toFormated string
public void calculateStatistics();

calculates statistics
public void setProjectID(String aProjectID);

public void setSessionID(String aSessionID);

public void setSimulationNumber(Integer aSimulationNumber);

public void setCurrentSession(FWSimSession aFwSimSession);

public void removeVariable(String aElement);

use with care! Variable might be needed
public Object[] filterData(HashMap aFilterMap);

filters data from the map and returns it as Object[]
returns
public Object[] filterData(Set aKeySet);

filters data from the map and returns it as Object[]
returns
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
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);

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(FWSimSession aSession);

deep clone on the SimVarMap - no references will stay same!
returns
public FWSimVarMap cloneToControlMap();

deep clone on the SimVarMap - no references will stay same!
returns
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 FWSimVariable getSimVariable(String aKey)
throws SimFieldMissingException;


returns the registered FWSimVariable - need not be the one with 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 Set getVariables(FWSimVariable.CONTENT_TYPE aContentType);


returns a list of Variables having this content type
public MultiHashMap getVariables(FWSimFieldContainer aContainer);


returns a list of Variables having this source container
public boolean has(String aName); // From
org.apache.commons.jexl3.JexlContext


Decorates the class as MapContext
public Object get(String aName); // From
org.apache.commons.jexl3.JexlContext


Decorates the class as MapContext
public void set(String aName, Object aValue); // From
org.apache.commons.jexl3.JexlContext


Decorates the class as MapContext
public boolean checkInternal(FWSimVariable aFwSimVariable);



}



Passed to: net.simplace.sim.io.output.FWSimOutputManager.addOutput(), net.simplace.sim.control.FWSimulationGenerator.addSimulation(), net.simplace.sim.io.output.adapter.CacheOutputAdapter(), net.simplace.sim.io.output.adapter.CacheOutputAdapter(), net.simplace.sim.io.output.FWSimOutputManager.calculateStatistics(), FWSimVariable.calculateValue(), FWSimHelper.checkForAction(), net.simplace.sim.check.FWCheckHelper.checkResource(), net.simplace.sim.io.output.FWSimOutputManager.checkSkipAboveSize(), net.simplace.sim.components.FWSimpleSimComponent.clone(), net.simplace.sim.components.DefaultManagement.clone(), net.simplace.sim.control.FWExchangeComponent.clone(), net.simplace.sim.control.exchange.DefaultExchangeComponent.clone(), net.simplace.sim.model.FWSimModel.clone(), net.simplace.sim.model.FWSimComponent.clone(), FWSimVariable.clone(), net.simplace.sim.io.output.FWSimOutputAdapter.createAdapter(), net.simplace.sim.control.FWExchangeComponent.createExchangeComponent(), net.simplace.sim.control.FWExchangeComponent.createExchangeComponent(), net.simplace.sim.model.FWSimComponent.createSimComponent(), net.simplace.sim.model.FWSimComponent.createSimComponent(), FWSimCalibrationVariable.createSimVariable(), net.simplace.sim.io.output.adapter.CSVOutputAdapter(), net.simplace.sim.io.output.adapter.DatabaseOutputAdapter(), net.simplace.sim.io.output.adapter.DatabaseOutputAdapter(), net.simplace.sim.wrapper.DataContainer(), net.simplace.sim.wrapper.DataContainer(), FWSimVariable.deepClone(), net.simplace.sim.control.exchange.DefaultExchangeComponent(), net.simplace.sim.components.DefaultManagement(), FWSimVariable.evaluate(), net.simplace.sim.control.FWSimulationControlContainer.evaluate(), net.simplace.sim.io.output.FWSimOutputCache.fill(), FWSimVariable.fillMetaDataFromSource(), net.simplace.sim.io.resources.FWSimResourceTransformer.fillVarMap(), net.simplace.sim.transformers.DefaultSQLStatementTransformer.fillVarMap(), net.simplace.sim.io.resources.FWSimResourceCache.fillVarMapFromCache(), net.simplace.sim.io.resources.FWSimResourceCache.fillVarMapFromDatabase(), net.simplace.sim.io.output.FWSimOutputManager.finishSimulationOutputs(), net.simplace.sim.control.FWExchangeComponent(), net.simplace.sim.io.output.FWSimCalibrationOutput(), net.simplace.sim.io.output.FWSimCalibrationOutput(), FWSimCalibrationVariable.FWSimCalibrationVariable(), net.simplace.sim.model.FWSimComponent(), net.simplace.sim.model.FWSimComponentGroup(), net.simplace.sim.model.FWSimModel(), net.simplace.sim.io.output.FWSimOutput(), net.simplace.sim.io.output.FWSimOutput(), net.simplace.sim.io.output.FWSimOutputAdapter(), net.simplace.sim.io.output.FWSimOutputCache(), net.simplace.sim.event.FWSimOutputEvent(), net.simplace.sim.components.FWSimpleSimComponent(), net.simplace.sim.components.FWSimpleSimComponent(), net.simplace.sim.FWSimSession(), net.simplace.sim.FWSimSimulation(), net.simplace.sim.FWSimSolution(), FWSimVariable.FWSimVariable(), FWSimVariable.FWSimVariable(), net.simplace.sim.io.output.FWSimOutputCache.generate(), FWSimCalibrationVariable.getBooleanPropertyValue(), net.simplace.sim.io.resources.FWSimInputAdapter.getData(), net.simplace.sim.io.resources.adapter.XMLResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.NetCDFResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.LEdataResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.DatabaseResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.CSVResourceAdapter.getData(), net.simplace.sim.transformers.DefaultSQLStatementTransformer.getData(), net.simplace.sim.transformers.DefaultRuleTransformer.getData(), net.simplace.sim.io.resources.adapter.XMLResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.NetCDFResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.LEdataResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.CSVResourceAdapter.getData(), FWSimCalibrationVariable.getDoublePropertyValue(), net.simplace.sim.io.FilePoolManager.getFile(), FWSimCalibrationVariable.getIntegerPropertyValue(), net.simplace.sim.io.interfaces.NetCDFInterface.getInterface(), net.simplace.sim.io.interfaces.MEMORYInterface.getInterface(), net.simplace.sim.io.interfaces.LEDataInterface.getInterface(), net.simplace.sim.io.interfaces.FWSimInterface.getInterface(), net.simplace.sim.io.interfaces.FILEInterface.getInterface(), net.simplace.sim.io.interfaces.DatabaseInterface.getInterface(), net.simplace.sim.io.interfaces.CSVInterface.getInterface(), FWSimHelper.getObjectArrayFromVarMap(), FWSimCalibrationVariable.getProperty(), FWSimCalibrationVariable.getPropertyValue(), net.simplace.sim.io.resources.adapter.DBFResourceAdapter.getResultSet(), net.simplace.sim.io.resources.adapter.DatabaseResourceAdapter.getResultSet(), net.simplace.sim.transformers.DefaultSQLStatementTransformer.getResultSet(), net.simplace.sim.io.resources.FWSimResourceTransformer.getSourceResourceCache(), FWSimCalibrationVariable.getStringPropertyValue(), FWSimHelper.getValueFromSpecialParameter(), net.simplace.sim.io.output.FWSimOutputAdapter.init(), net.simplace.sim.io.output.adapter.NetCDFOutputAdapter.init(), net.simplace.sim.io.output.adapter.DatabaseOutputAdapter.init(), net.simplace.sim.io.output.adapter.CSVOutputAdapter.init(), net.simplace.sim.io.output.adapter.CacheOutputAdapter.init(), net.simplace.sim.io.output.FWSimOutputAdapter.initialize(), net.simplace.sim.io.output.FWSimOutput.initialize(), net.simplace.sim.model.FWSimVarLink.initialize(), net.simplace.sim.io.output.FWSimOutputManager.initializeOutputs(), net.simplace.sim.FWSimSession.initProjects(), net.simplace.sim.io.resources.FWSimResourceTransformer.isUpdated(), net.simplace.sim.io.output.adapter.NetCDFOutputAdapter(), net.simplace.sim.io.output.FWSimCalibrationOutput.OUTPUT(), net.simplace.sim.io.output.FWSimOutput.OUTPUT(), net.simplace.sim.io.output.FWSimOutputManager.OUTPUT(), net.simplace.sim.io.output.FWSimOutputManager.outputCalibrationResult(), net.simplace.sim.FWSimEngine.prepareSession(), net.simplace.sim.io.FilePool.registerFile(), net.simplace.sim.io.output.FWSimOutput.removeSimulationCache(), FWSimHelper.replaceParamTokens(), net.simplace.sim.control.FWExchangeComponent.reset(), net.simplace.sim.model.FWSimModel.reset(), net.simplace.sim.model.FWSimComponent.reset(), FWSimVariable.setVarMap(), net.simplace.sim.io.resources.FWSimResourceCache.shouldUpdate(), net.simplace.sim.io.output.FWSimOutput.updateAdapter(), net.simplace.sim.io.output.FWSimOutputManager.updateAdapter(), net.simplace.sim.io.output.adapter.NetCDFOutputAdapter.updateFile(), net.simplace.sim.io.output.adapter.CSVOutputAdapter.updateFile(), net.simplace.sim.io.output.FWSimOutputManager.updateInterface(), net.simplace.sim.io.resources.FWSimResourceManager.updateInterface(), net.simplace.sim.io.resources.FWSimResourceManager.updateResources(), net.simplace.sim.io.resources.FWSimResourceManager.updateVarMap()



Returned by: net.simplace.sim.FWSimSimulation.call(), net.simplace.sim.model.FWSimModel.call(), clone(), cloneToControlMap(), net.simplace.sim.control.FWSimulationControlCache.getControlMap(), net.simplace.sim.FWSimSolution.getVarMap(), net.simplace.sim.FWSimSimulation.getVarMap(), net.simplace.sim.control.FWSimulationControlContainer.getVarMap(), net.simplace.sim.control.FWSimulationControlCache.getVarMap(), net.simplace.sim.control.FWExchangeComponent.getVarMap(), net.simplace.sim.event.FWSimOutputEvent.getVarMap(), net.simplace.sim.io.output.FWSimResultCache.getVarMap(), net.simplace.sim.io.output.FWSimOutputAdapter.getVarMap(), net.simplace.sim.io.resources.FWSimResourceCache.getVarMap(), net.simplace.sim.io.resources.FWSimInputAdapter.getVarMap(), net.simplace.sim.model.FWSimModel.getVarMap(), net.simplace.sim.model.FWSimComponent.getVarMap(), FWSimVariable.getVarMap(), FWSimFieldContainerGroup.getVarMap(), FWSimFieldContainer.getVarMap()



Type of: net.simplace.sim.control.FWSimulationControlContainer.iControlMap, net.simplace.sim.control.FWExchangeComponent.iControlVarMap, net.simplace.sim.control.FWSimulationControlContainer.iSimulationMap, net.simplace.sim.model.FWSimComponent.iVarMap