public class SimulationVariable extends Object
| Modifier and Type | Field and Description |
|---|---|
protected SimulationContext |
simulationContext
Simulation context (to get db).
|
protected org.nuiton.topia.persistence.TopiaEntity |
topiaEntity
Managed entity id.
|
protected Map<String,Variable> |
variablesCache
Variable name > variable entity.
|
| Constructor and Description |
|---|
SimulationVariable(SimulationContext simulationContext,
org.nuiton.topia.persistence.TopiaEntity topiaEntity) |
| Modifier and Type | Method and Description |
|---|---|
double |
eval(String name)
Eval current variable equation.
|
protected double |
eval(Variable v)
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(String name,
Object value)
Set variable value.
|
protected SimulationContext simulationContext
protected org.nuiton.topia.persistence.TopiaEntity topiaEntity
public SimulationVariable(SimulationContext simulationContext, org.nuiton.topia.persistence.TopiaEntity topiaEntity)
protected Variable getVariableEntity(String name) throws org.nuiton.topia.TopiaException
name - variable name to getorg.nuiton.topia.TopiaException - if can't restore variable from dbpublic double getAsDouble(String name) throws org.nuiton.topia.TopiaException
name - variable nameorg.nuiton.topia.TopiaException - if can't restore variable from dbpublic org.nuiton.math.matrix.MatrixND getAsMatrix(String name) throws org.nuiton.topia.TopiaException
name - variable nameorg.nuiton.topia.TopiaException - if can't restore variable from dbpublic void set(String name, Object value) throws org.nuiton.topia.TopiaException
name - variable namevalue - new valueorg.nuiton.topia.TopiaException - if can't restore variable from dbpublic double eval(String name) throws org.nuiton.topia.TopiaException
name - variable nameorg.nuiton.topia.TopiaException - if can't restore variable from dbprotected double eval(Variable v)
v - variableCopyright © 1999-2012 CodeLutin. All Rights Reserved.