org.jcpsim.parameter
Class Parameter

java.lang.Object
  extended by org.jcpsim.parameter.Parameter
Direct Known Subclasses:
Input, Output

public abstract class Parameter
extends java.lang.Object

Stores a value. The value can be accessed with the get() and set() Method.
TODO: jCpSim should have global values for SimulationTime, RealTime and LastStepSize. TODO: flag for functions with f'(t) >= 0 or f'(t) <= 0; (they are continuously ascending or descending) Examples: Simulation Time, Infused Volume, ... These are the functions that cannot not be represented as loops!


Field Summary
 org.jcpsim.parameter.Parameter.Scale scale
           
 
Constructor Summary
Parameter(ParameterMeta meta, java.lang.String key, Unit unit, double min, double max, double step)
          Creates a parameter.
 
Method Summary
 void compute()
          Can be overridden.
 double get()
           
 double getBarW(double w)
           
 double getBarX(double w)
           
 double getBoxed()
           
 double getBoxedRatio()
           
 int getId()
          Returns the id number of the Block the Parameter belongs to. -1: not set.
 java.lang.String getKey()
           
 java.lang.String getLongName()
          Returns the long internationalized name.
 double getMax()
           
 double getMin()
           
 java.lang.String getName()
          Returns the short internationalized name.
 boolean getOptimize()
          Returns whether this Parameter used for optimization.
 ParameterMeta getParameterMeta()
           
 double getRaw()
           
 double getStep()
           
 Unit getUnit()
           
 java.lang.String I18N(java.lang.String ext)
          Internationalization support.
 double Ratio(double x)
           
 void set(double v)
           
 void setOptimize(boolean o)
          Sets whether this Parameter used for optimization.
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 java.lang.String toUrl()
           
 java.lang.String valueAndUnit()
           
 java.lang.String valueAsString()
           
 void valueChanged()
          Can be overridden by subclass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scale

public org.jcpsim.parameter.Parameter.Scale scale
Constructor Detail

Parameter

public Parameter(ParameterMeta meta,
                 java.lang.String key,
                 Unit unit,
                 double min,
                 double max,
                 double step)
Creates a parameter.

Parameters:
meta - Provides information (name etc.) about the parent of the parameter.
key - The key in the properties file (for I18N).
unit - The physical unit (like "ml/min")
Method Detail

getMin

public double getMin()

getMax

public double getMax()

getStep

public double getStep()

getKey

public java.lang.String getKey()

getId

public int getId()
Returns the id number of the Block the Parameter belongs to. -1: not set.


getParameterMeta

public ParameterMeta getParameterMeta()

getRaw

public double getRaw()

get

public double get()

set

public void set(double v)

Ratio

public double Ratio(double x)

getBoxed

public double getBoxed()

getBoxedRatio

public double getBoxedRatio()

getBarX

public double getBarX(double w)

getBarW

public double getBarW(double w)

valueAsString

public java.lang.String valueAsString()

I18N

public java.lang.String I18N(java.lang.String ext)
Internationalization support.

Parameters:
ext - Find I18N string for key + "_" + ext.
Returns:
The internationalized string.

getName

public java.lang.String getName()
Returns the short internationalized name.


getLongName

public java.lang.String getLongName()
Returns the long internationalized name.


getUnit

public Unit getUnit()

setOptimize

public void setOptimize(boolean o)
Sets whether this Parameter used for optimization.


getOptimize

public boolean getOptimize()
Returns whether this Parameter used for optimization.


compute

public void compute()
Can be overridden.


valueChanged

public void valueChanged()
Can be overridden by subclass.


valueAndUnit

public java.lang.String valueAndUnit()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toShortString

public java.lang.String toShortString()

toUrl

public java.lang.String toUrl()


jCpSim (Java CardioPulmonary SIMulations), v0.2.01
Dr. Frank Fischer, frank@jcpsim.org, http://www.jcpsim.org