org.simulator.sbml.astnode
Class ASTNodeInterpreter

java.lang.Object
  extended by org.simulator.sbml.astnode.ASTNodeInterpreter

public class ASTNodeInterpreter
extends Object

This class is an efficient ASTNodeInterpreter that takes the time of the calculation into account. It contains functions similar to the ASTNodeCompiler interface, which have the current time as additional argument.

Since:
1.0
Version:
$Rev: 205 $
Author:
Roland Keller

Field Summary
static Logger logger
          A logger.
 
Constructor Summary
ASTNodeInterpreter(SBMLValueHolder valueHolder)
           
 
Method Summary
 double abs(ASTNodeValue userObject, double time)
           
 boolean and(ASTNodeValue[] children, int size, double time)
           
 double arccos(ASTNodeValue userObject, double time)
           
 double arccosh(ASTNodeValue userObject, double time)
           
 double arccot(ASTNodeValue userObject, double time)
           
 double arccoth(ASTNodeValue userObject, double time)
           
 double arccsc(ASTNodeValue userObject, double time)
           
 double arccsch(ASTNodeValue userObject, double time)
           
 double arcsec(ASTNodeValue userObject, double time)
           
 double arcsech(ASTNodeValue userObject, double time)
           
 double arcsin(ASTNodeValue userObject, double time)
           
 double arcsinh(ASTNodeValue userObject, double time)
           
 double arctan(ASTNodeValue userObject, double time)
           
 double arctanh(ASTNodeValue userObject, double time)
           
 double ceiling(ASTNodeValue userObject, double time)
           
 double compile(double mantissa, int exponent, String units)
           
 double compile(double value, String units)
           
 boolean compileBoolean(CallableSBase nsb, double time)
           
 double compileDouble(CallableSBase nsb, double time)
           
 double compileDouble(String name, double time)
           
 String compileString(ASTNode child)
           
 String compileString(ASTNodeValue child)
           
 double cos(ASTNodeValue userObject, double time)
           
 double cosh(ASTNodeValue userObject, double time)
           
 double cot(ASTNodeValue userObject, double time)
           
 double coth(ASTNodeValue userObject, double time)
           
 double csc(ASTNodeValue userObject, double time)
           
 double csch(ASTNodeValue userObject, double time)
           
 double delay(String delayName, ASTNodeValue x, ASTNodeValue delay, String timeUnits, double time)
           
 boolean eq(ASTNodeValue left, ASTNodeValue right, double time)
           
 double exp(ASTNodeValue userObject, double time)
           
 double factorial(ASTNodeValue userObject, double time)
           
 double floor(ASTNodeValue userObject, double time)
           
 double frac(ASTNodeValue left, ASTNodeValue right, double time)
           
 double frac(int numerator, int denominator)
           
 boolean functionBoolean(ASTNodeValue rightChild, List<String> variables, ASTNodeValue[] children, double[] values, double time)
           
 boolean functionBoolean(String name, List<ASTNodeValue> children)
           
 double functionDouble(ASTNodeValue rightChild, List<String> variables, ASTNodeValue[] children, int nArguments, double[] values, double time)
           
 double functionDouble(String functionDefinitionName, List<ASTNodeValue> args, double time)
           
 boolean geq(ASTNodeValue left, ASTNodeValue right, double time)
           
 boolean gt(ASTNodeValue left, ASTNodeValue right, double time)
           
 boolean lambdaBoolean(ASTNodeValue[] children, double time)
           
 double lambdaDouble(ASTNodeValue[] children, double time)
           
 boolean leq(ASTNodeValue left, ASTNodeValue right, double time)
           
 double ln(ASTNodeValue userObject, double time)
           
 double log(ASTNodeValue left, ASTNodeValue right, double time)
           
 double log(ASTNodeValue userObject, double time)
           
 boolean lt(ASTNodeValue left, ASTNodeValue right, double time)
           
 double minus(ASTNodeValue[] children, int size, double time)
           
 boolean neq(ASTNodeValue left, ASTNodeValue right, double time)
           
 boolean not(ASTNodeValue node, double time)
           
 boolean or(ASTNodeValue[] children, double time)
           
 double piecewise(ASTNodeValue[] children, double time)
           
 double plus(ASTNodeValue[] children, int size, double time)
           
 double pow(ASTNodeValue left, ASTNodeValue right, double time)
           
 double root(ASTNodeValue rootExponent, ASTNodeValue radiant, double time)
           
 double root(double rootExponent, ASTNodeValue userObject, double time)
           
 double sec(ASTNodeValue userObject, double time)
           
 double sech(ASTNodeValue userObject, double time)
           
 double sin(ASTNodeValue userObject, double time)
           
 double sinh(ASTNodeValue userObject, double time)
           
 double sqrt(ASTNodeValue userObject, double time)
           
 double symbolTime(String name)
           
 double tan(ASTNodeValue userObject, double time)
           
 double tanh(ASTNodeValue userObject, double time)
           
 double times(ASTNodeValue[] children, int size, double time)
           
 String toString(ASTNode value)
           
 double uMinus(ASTNodeValue userObject, double time)
           
 boolean xor(ASTNodeValue[] children, double time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final Logger logger
A logger.

Constructor Detail

ASTNodeInterpreter

public ASTNodeInterpreter(SBMLValueHolder valueHolder)
Parameters:
valueHolder -
Method Detail

toString

public final String toString(ASTNode value)
Parameters:
value -
Returns:
stringValue the interpreted String value of the node

compileDouble

public double compileDouble(String name,
                            double time)
Parameters:
name -
time -
Returns:
doubleValue the interpreted double value of the node

compileDouble

public double compileDouble(CallableSBase nsb,
                            double time)
Parameters:
nsb -
time -
Returns:
doubleValue the interpreted double value of the node

compileBoolean

public boolean compileBoolean(CallableSBase nsb,
                              double time)
Parameters:
nsb -
time -
Returns:
booleanValue the interpreted boolean value of the node

functionDouble

public double functionDouble(ASTNodeValue rightChild,
                             List<String> variables,
                             ASTNodeValue[] children,
                             int nArguments,
                             double[] values,
                             double time)
Parameters:
rightChild -
variables -
children -
nArguments -
values -
time -
Returns:
doubleValue the interpreted double value of the node

compileString

public String compileString(ASTNodeValue child)
Parameters:
child -
Returns:
stringValue the interpreted String value of the node

compileString

public String compileString(ASTNode child)
Parameters:
child -
Returns:
stringValue the interpreted String value of the node

lambdaDouble

public double lambdaDouble(ASTNodeValue[] children,
                           double time)
Parameters:
children -
time -
Returns:
doubleValue the interpreted double value of the node

lambdaBoolean

public boolean lambdaBoolean(ASTNodeValue[] children,
                             double time)
Parameters:
children -
time -
Returns:
booleanValue the interpreted boolean value of the node

piecewise

public double piecewise(ASTNodeValue[] children,
                        double time)
Parameters:
children -
time -
Returns:
doubleValue the interpreted double value of the node

log

public double log(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

log

public double log(ASTNodeValue left,
                  ASTNodeValue right,
                  double time)
Parameters:
left -
right -
time -
Returns:
doubleValue the interpreted double value of the node

functionDouble

public double functionDouble(String functionDefinitionName,
                             List<ASTNodeValue> args,
                             double time)
Parameters:
functionDefinitionName -
args -
time -
Returns:
doubleValue the interpreted double value of the nodedoubleValue the interpreted double value of the node

tanh

public double tanh(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

tan

public double tan(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

sinh

public double sinh(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

sin

public double sin(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

sech

public double sech(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

sec

public double sec(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

root

public double root(ASTNodeValue rootExponent,
                   ASTNodeValue radiant,
                   double time)
Parameters:
rootExponent -
radiant -
time -
Returns:
doubleValue the interpreted double value of the node

root

public double root(double rootExponent,
                   ASTNodeValue userObject,
                   double time)
Parameters:
rootExponent -
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

ln

public double ln(ASTNodeValue userObject,
                 double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

floor

public double floor(ASTNodeValue userObject,
                    double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

factorial

public double factorial(ASTNodeValue userObject,
                        double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

exp

public double exp(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

csch

public double csch(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

csc

public double csc(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

coth

public double coth(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

cot

public double cot(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

cosh

public double cosh(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

cos

public double cos(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

ceiling

public double ceiling(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arctanh

public double arctanh(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

functionBoolean

public boolean functionBoolean(String name,
                               List<ASTNodeValue> children)
Parameters:
name -
children -
Returns:
booleanValue the interpreted boolean value of the node

functionBoolean

public boolean functionBoolean(ASTNodeValue rightChild,
                               List<String> variables,
                               ASTNodeValue[] children,
                               double[] values,
                               double time)
Parameters:
rightChild -
variables -
children -
values -
time -
Returns:
booleanValue the interpreted boolean value of the node

lt

public boolean lt(ASTNodeValue left,
                  ASTNodeValue right,
                  double time)
Parameters:
left -
right -
time -
Returns:
booleanValue the interpreted boolean value of the node

leq

public boolean leq(ASTNodeValue left,
                   ASTNodeValue right,
                   double time)
Parameters:
left -
right -
time -
Returns:
booleanValue the interpreted boolean value of the node

neq

public boolean neq(ASTNodeValue left,
                   ASTNodeValue right,
                   double time)
Parameters:
left -
right -
time -
Returns:
booleanValue the interpreted boolean value of the node

gt

public boolean gt(ASTNodeValue left,
                  ASTNodeValue right,
                  double time)
Parameters:
left -
right -
time -
Returns:
booleanValue the interpreted boolean value of the node

geq

public boolean geq(ASTNodeValue left,
                   ASTNodeValue right,
                   double time)
Parameters:
left -
right -
time -
Returns:
booleanValue the interpreted boolean value of the node

eq

public boolean eq(ASTNodeValue left,
                  ASTNodeValue right,
                  double time)
Parameters:
left -
right -
time -
Returns:
booleanValue the interpreted boolean value of the node

not

public boolean not(ASTNodeValue node,
                   double time)
Parameters:
node -
time -
Returns:
booleanValue the interpreted boolean value of the node

or

public boolean or(ASTNodeValue[] children,
                  double time)
Parameters:
children -
time -
Returns:
booleanValue the interpreted boolean value of the node

xor

public boolean xor(ASTNodeValue[] children,
                   double time)
Parameters:
children -
time -
Returns:
booleanValue the interpreted boolean value of the node

and

public boolean and(ASTNodeValue[] children,
                   int size,
                   double time)
Parameters:
children -
time -
Returns:
booleanValue the interpreted boolean value of the node

arctan

public double arctan(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arcsinh

public double arcsinh(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arcsin

public double arcsin(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arcsech

public double arcsech(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arcsec

public double arcsec(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arccsch

public double arccsch(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arccsc

public double arccsc(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arccoth

public double arccoth(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arccot

public double arccot(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arccosh

public double arccosh(ASTNodeValue userObject,
                      double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

arccos

public double arccos(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

abs

public double abs(ASTNodeValue userObject,
                  double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

compile

public double compile(double mantissa,
                      int exponent,
                      String units)
Parameters:
mantissa -
exponent -
units -
Returns:
doubleValue the interpreted double value of the node

delay

public final double delay(String delayName,
                          ASTNodeValue x,
                          ASTNodeValue delay,
                          String timeUnits,
                          double time)
Parameters:
delayName -
x -
delay -
timeUnits -
time -
Returns:
doubleValue the interpreted double value of the node

symbolTime

public double symbolTime(String name)
Parameters:
name -
Returns:
doubleValue the interpreted double value of the node

frac

public double frac(int numerator,
                   int denominator)
Parameters:
numerator -
denominator -
Returns:
doubleValue the interpreted double value of the node

frac

public double frac(ASTNodeValue left,
                   ASTNodeValue right,
                   double time)
Parameters:
left -
right -
time -
Returns:
doubleValue the interpreted double value of the node

times

public double times(ASTNodeValue[] children,
                    int size,
                    double time)
Parameters:
children -
size -
time -
Returns:
doubleValue the interpreted double value of the node

minus

public double minus(ASTNodeValue[] children,
                    int size,
                    double time)
Parameters:
children -
size -
time -
Returns:
doubleValue the interpreted double value of the node

plus

public double plus(ASTNodeValue[] children,
                   int size,
                   double time)
Parameters:
children -
size -
time -
Returns:
doubleValue the interpreted double value of the node

pow

public double pow(ASTNodeValue left,
                  ASTNodeValue right,
                  double time)
Parameters:
left -
right -
time -
Returns:
doubleValue the interpreted double value of the node

compile

public double compile(double value,
                      String units)
Parameters:
value -
units -
Returns:
doubleValue the interpreted double value of the node

sqrt

public double sqrt(ASTNodeValue userObject,
                   double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

uMinus

public double uMinus(ASTNodeValue userObject,
                     double time)
Parameters:
userObject -
time -
Returns:
doubleValue the interpreted double value of the node

Generated December 13 2012