Package fr.ifremer.isisfish.simulator
Class SimulationVariable
java.lang.Object
fr.ifremer.isisfish.simulator.SimulationVariable
Object containing cached variable value for a specific entity.
- Since:
- 4.1.0.0 Last update : $Date$ By : $Author$
- Version:
- $Revision$
- Author:
- chatellier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimulationContextSimulation context (to get db).protected org.nuiton.topia.persistence.TopiaEntityManaged entity id.Variable name > variable entity. -
Constructor Summary
ConstructorsConstructorDescriptionSimulationVariable(SimulationContext simulationContext, org.nuiton.topia.persistence.TopiaEntity topiaEntity) -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleEval current variable equation.doubleEval current variable equation.doublegetAsDouble(String name) Return variable value as double.org.nuiton.math.matrix.MatrixNDgetAsMatrix(String name) Return variable value as matrix.protected VariablegetVariableEntity(String name) Return variable entity from cache or database.voidSet variable value.
-
Field Details
-
simulationContext
Simulation context (to get db). -
topiaEntity
protected org.nuiton.topia.persistence.TopiaEntity topiaEntityManaged entity id. -
variablesCache
Variable name > variable entity.
-
-
Constructor Details
-
SimulationVariable
public SimulationVariable(SimulationContext simulationContext, org.nuiton.topia.persistence.TopiaEntity topiaEntity)
-
-
Method Details
-
getVariableEntity
Return variable entity from cache or database.- Parameters:
name- variable name to get- Returns:
- variable entity
- Throws:
org.nuiton.topia.TopiaException- if can't restore variable from db
-
getAsDouble
Return variable value as double.- Parameters:
name- variable name- Returns:
- value as double
- Throws:
org.nuiton.topia.TopiaException- if can't restore variable from db
-
getAsMatrix
public org.nuiton.math.matrix.MatrixND getAsMatrix(String name) throws org.nuiton.topia.TopiaException Return variable value as matrix.- Parameters:
name- variable name- Returns:
- value as matrix
- Throws:
org.nuiton.topia.TopiaException- if can't restore variable from db
-
set
Set variable value.- Parameters:
name- variable namevalue- new value- Throws:
org.nuiton.topia.TopiaException- if can't restore variable from db
-
eval
Eval current variable equation.- Parameters:
name- variable name- Returns:
- equation result
- Throws:
org.nuiton.topia.TopiaException- if can't restore variable from db
-
eval
Eval current variable equation.- Parameters:
v- variable- Returns:
- equation result
-