Class SimulationVariable

java.lang.Object
fr.ifremer.isisfish.simulator.SimulationVariable

public class SimulationVariable extends Object
Object containing cached variable value for a specific entity.
Since:
4.1.0.0 Last update : $Date$ By : $Author$
Version:
$Revision$
Author:
chatellier
  • Field Details

    • simulationContext

      protected SimulationContext simulationContext
      Simulation context (to get db).
    • topiaEntity

      protected org.nuiton.topia.persistence.TopiaEntity topiaEntity
      Managed entity id.
    • variablesCache

      protected Map<String,Variable> variablesCache
      Variable name > variable entity.
  • Constructor Details

    • SimulationVariable

      public SimulationVariable(SimulationContext simulationContext, org.nuiton.topia.persistence.TopiaEntity topiaEntity)
  • Method Details

    • getVariableEntity

      protected Variable getVariableEntity(String name) throws org.nuiton.topia.TopiaException
      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

      public double getAsDouble(String name) throws org.nuiton.topia.TopiaException
      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

      public void set(String name, Object value) throws org.nuiton.topia.TopiaException
      Set variable value.
      Parameters:
      name - variable name
      value - new value
      Throws:
      org.nuiton.topia.TopiaException - if can't restore variable from db
    • eval

      public double eval(String name) throws org.nuiton.topia.TopiaException
      Eval current variable equation.
      Parameters:
      name - variable name
      Returns:
      equation result
      Throws:
      org.nuiton.topia.TopiaException - if can't restore variable from db
    • eval

      protected double eval(Variable v)
      Eval current variable equation.
      Parameters:
      v - variable
      Returns:
      equation result