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
Modifier and TypeFieldDescriptionprotected SimulationContext
Simulation context (to get db).protected org.nuiton.topia.persistence.TopiaEntity
Managed entity id.Variable name > variable entity. -
Constructor Summary
ConstructorDescriptionSimulationVariable
(SimulationContext simulationContext, org.nuiton.topia.persistence.TopiaEntity topiaEntity) -
Method Summary
Modifier and TypeMethodDescriptionprotected double
Eval current variable equation.double
Eval current variable equation.double
getAsDouble
(String name) Return variable value as double.org.nuiton.math.matrix.MatrixND
getAsMatrix
(String name) Return variable value as matrix.protected Variable
getVariableEntity
(String name) Return variable entity from cache or database.void
Set 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
-