org.sbml.jsbml.util.compilers
public interface ASTNodeCompiler
ASTNodes. It defines how to perform mathematical or
other operations on these data types. Recursion can be performed as follows:
public ASTNodeValue doSomeThing(ASTNode ast) {
...
ASTNodeValue child = ast.compile(this);
...
return new ASTNodeValue(doSomeThing(child), this);
}
| Modifier and Type | Method and Description |
|---|---|
ASTNodeValue |
abs(ASTNode value)
The absolute value represented by the given
ASTNode. |
ASTNodeValue |
and(java.util.List<ASTNode> values) |
ASTNodeValue |
arccos(ASTNode value) |
ASTNodeValue |
arccosh(ASTNode value) |
ASTNodeValue |
arccot(ASTNode value) |
ASTNodeValue |
arccoth(ASTNode value) |
ASTNodeValue |
arccsc(ASTNode value) |
ASTNodeValue |
arccsch(ASTNode value) |
ASTNodeValue |
arcsec(ASTNode value) |
ASTNodeValue |
arcsech(ASTNode value) |
ASTNodeValue |
arcsin(ASTNode value) |
ASTNodeValue |
arcsinh(ASTNode value) |
ASTNodeValue |
arctan(ASTNode value) |
ASTNodeValue |
arctanh(ASTNode value) |
ASTNodeValue |
ceiling(ASTNode value) |
ASTNodeValue |
compile(CallableSBase variable) |
ASTNodeValue |
compile(Compartment c) |
ASTNodeValue |
compile(double mantissa,
int exponent,
java.lang.String units)
Creates an
ASTNodeValue that represents a real number in
scientific notation, i.e., mantissa * 10^exponent, and the given units. |
ASTNodeValue |
compile(double real,
java.lang.String units) |
ASTNodeValue |
compile(int integer,
java.lang.String units) |
ASTNodeValue |
compile(java.lang.String name)
A compiler will also have to deal with a name.
|
ASTNodeValue |
cos(ASTNode value) |
ASTNodeValue |
cosh(ASTNode value) |
ASTNodeValue |
cot(ASTNode value) |
ASTNodeValue |
coth(ASTNode value) |
ASTNodeValue |
csc(ASTNode value) |
ASTNodeValue |
csch(ASTNode value) |
ASTNodeValue |
delay(java.lang.String delayName,
ASTNode x,
ASTNode delay,
java.lang.String timeUnits)
Evaluates delay functions.
|
ASTNodeValue |
eq(ASTNode left,
ASTNode right)
Equal.
|
ASTNodeValue |
exp(ASTNode value) |
ASTNodeValue |
factorial(ASTNode value) |
ASTNodeValue |
floor(ASTNode value) |
ASTNodeValue |
frac(ASTNode numerator,
ASTNode denominator)
Fraction of two
ASTNodes |
ASTNodeValue |
frac(int numerator,
int denominator)
A fraction of two int values.
|
ASTNodeValue |
function(FunctionDefinition functionDefinition,
java.util.List<ASTNode> args) |
ASTNodeValue |
function(java.lang.String functionDefinitionName,
java.util.List<ASTNode> args) |
ASTNodeValue |
geq(ASTNode left,
ASTNode right)
Greater equal.
|
ASTNodeValue |
getConstantAvogadro(java.lang.String name)
Creates an
ASTNodeValue that represent's Avogadro's number. |
ASTNodeValue |
getConstantE() |
ASTNodeValue |
getConstantFalse() |
ASTNodeValue |
getConstantPi() |
ASTNodeValue |
getConstantTrue() |
ASTNodeValue |
getNegativeInfinity() |
ASTNodeValue |
getPositiveInfinity() |
ASTNodeValue |
gt(ASTNode left,
ASTNode right)
Greater than.
|
ASTNodeValue |
lambda(java.util.List<ASTNode> values)
The body of a
FunctionDefinition. |
ASTNodeValue |
leq(ASTNode left,
ASTNode right)
Less equal.
|
ASTNodeValue |
ln(ASTNode value)
Natural logarithm.
|
ASTNodeValue |
log(ASTNode value)
Logarithm of the given value to base 10.
|
ASTNodeValue |
log(ASTNode base,
ASTNode value)
Logarithm of the given value to the given base.
|
ASTNodeValue |
lt(ASTNode left,
ASTNode right)
Less than.
|
ASTNodeValue |
minus(java.util.List<ASTNode> values)
Subtraction.
|
ASTNodeValue |
neq(ASTNode left,
ASTNode right)
Not equal.
|
ASTNodeValue |
not(ASTNode value) |
ASTNodeValue |
or(java.util.List<ASTNode> values) |
ASTNodeValue |
piecewise(java.util.List<ASTNode> values) |
ASTNodeValue |
plus(java.util.List<ASTNode> values) |
ASTNodeValue |
pow(ASTNode base,
ASTNode exponent) |
ASTNodeValue |
root(ASTNode rootExponent,
ASTNode radiant) |
ASTNodeValue |
root(double rootExponent,
ASTNode radiant) |
ASTNodeValue |
sec(ASTNode value) |
ASTNodeValue |
sech(ASTNode value) |
ASTNodeValue |
selector(java.util.List<ASTNode> nodes) |
ASTNodeValue |
sin(ASTNode value) |
ASTNodeValue |
sinh(ASTNode value) |
ASTNodeValue |
sqrt(ASTNode radiant)
Square root.
|
ASTNodeValue |
symbolTime(java.lang.String time)
The simulation time.
|
ASTNodeValue |
tan(ASTNode value) |
ASTNodeValue |
tanh(ASTNode value) |
ASTNodeValue |
times(java.util.List<ASTNode> values)
Product of all given
ASTNodes. |
ASTNodeValue |
uMinus(ASTNode value)
Unary minus, i.e., negation of the given
ASTNode. |
ASTNodeValue |
unknownValue()
Dealing with a malformed
ASTNode. |
ASTNodeValue |
xor(java.util.List<ASTNode> values)
Exclusive or.
|
ASTNodeValue abs(ASTNode value) throws SBMLException
ASTNode.value - Must be interpretable as a Number.SBMLExceptionASTNodeValue and(java.util.List<ASTNode> values) throws SBMLException
values - SBMLExceptionASTNodeValue arccos(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arccosh(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arccot(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arccoth(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arccsc(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arccsch(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arcsec(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arcsech(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arcsin(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arcsinh(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arctan(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue arctanh(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue ceiling(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue compile(Compartment c)
c - ASTNodeValue compile(double mantissa, int exponent, java.lang.String units)
ASTNodeValue that represents a real number in
scientific notation, i.e., mantissa * 10^exponent, and the given units.mantissa - The number to be multiplied with ten to the power of the given
exponent.exponent - The exponent for the multiplier ten.units - The identifier of the units object associated with the number
represented by this element. Can be null if no units have been
defined.ASTNodeValue compile(double real, java.lang.String units)
real - units - A String representing the Unit of the given number.
This can be the identifier of a UnitDefinition in the
model or a literal in Unit.Kind. Can be null if no units
have been defined.ASTNodeValue compile(int integer, java.lang.String units)
integer - units - A String representing the Unit of the given number.
This can be the identifier of a UnitDefinition in the
model or a literal in Unit.Kind. Can be null if no units
have been defined.ASTNodeValue compile(CallableSBase variable) throws SBMLException
variable - SBMLExceptionASTNodeValue compile(java.lang.String name)
Species in the
system. In case of numerical computation, the ASTNodeCompiler
must create an ASTNodeValue representing the current value of
this Species.name - ASTNodeValue cos(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue cosh(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue cot(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue coth(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue csc(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue csch(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue delay(java.lang.String delayName, ASTNode x, ASTNode delay, java.lang.String timeUnits) throws SBMLException
delayName - the name of this delay function.x - delay - an expression of a positive duration time (the amoutn of
delay)timeUnits - the units for the delay.SBMLExceptionASTNodeValue eq(ASTNode left, ASTNode right) throws SBMLException
left - right - SBMLExceptionASTNodeValue exp(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue factorial(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue floor(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue frac(ASTNode numerator, ASTNode denominator) throws SBMLException
ASTNodesnumerator - denominator - SBMLExceptionASTNodeValue frac(int numerator, int denominator) throws SBMLException
numerator - denominator - SBMLExceptionASTNodeValue function(FunctionDefinition functionDefinition, java.util.List<ASTNode> args) throws SBMLException
functionDefinition - args - Values to be inserted into the parameter list of the
function.SBMLExceptionASTNodeValue function(java.lang.String functionDefinitionName, java.util.List<ASTNode> args) throws SBMLException
functionDefinition - nameargs - Values to be inserted into the parameter list of the
function.SBMLExceptionASTNodeValue geq(ASTNode left, ASTNode right) throws SBMLException
left - right - SBMLExceptionASTNodeValue getConstantAvogadro(java.lang.String name)
ASTNodeValue that represent's Avogadro's number.
Optionally, the compiler may associate the given name with this number.name - An optional name for Avogadro's number.ASTNodeValue getConstantE()
ASTNodeValue getConstantFalse()
ASTNodeValue getConstantPi()
ASTNodeValue getConstantTrue()
ASTNodeValue getNegativeInfinity() throws SBMLException
SBMLExceptionASTNodeValue getPositiveInfinity()
ASTNodeValue gt(ASTNode left, ASTNode right) throws SBMLException
left - right - SBMLExceptionASTNodeValue lambda(java.util.List<ASTNode> values) throws SBMLException
FunctionDefinition.values - Place holders for arguments.SBMLExceptionASTNodeValue leq(ASTNode left, ASTNode right) throws SBMLException
left - right - SBMLExceptionASTNodeValue ln(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue log(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue log(ASTNode base, ASTNode value) throws SBMLException
base - value - SBMLExceptionASTNodeValue lt(ASTNode left, ASTNode right) throws SBMLException
left - right - SBMLExceptionASTNodeValue minus(java.util.List<ASTNode> values) throws SBMLException
values - SBMLExceptionASTNodeValue neq(ASTNode left, ASTNode right) throws SBMLException
left - right - SBMLExceptionASTNodeValue not(ASTNode value) throws SBMLException
value - This value must be interpretable as a Boolean.SBMLExceptionASTNodeValue or(java.util.List<ASTNode> values) throws SBMLException
values - These values must be interpretable as a Boolean.SBMLExceptionASTNodeValue piecewise(java.util.List<ASTNode> values) throws SBMLException
values - SBMLExceptionASTNodeValue plus(java.util.List<ASTNode> values) throws SBMLException
values - SBMLExceptionASTNodeValue pow(ASTNode base, ASTNode exponent) throws SBMLException
base - exponent - SBMLExceptionASTNodeValue root(ASTNode rootExponent, ASTNode radiant) throws SBMLException
rootExponent - radiant - SBMLExceptionASTNodeValue root(double rootExponent, ASTNode radiant) throws SBMLException
rootExponent - radiant - SBMLExceptionASTNodeValue sec(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue sech(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue selector(java.util.List<ASTNode> nodes) throws SBMLException
value - SBMLExceptionASTNodeValue sin(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue sinh(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue sqrt(ASTNode radiant) throws SBMLException
radiant - This value must be interpretable as a Number.SBMLExceptionASTNodeValue symbolTime(java.lang.String time)
time - The name of the time symbol.ASTNodeValue that represents the current time.ASTNodeValue tan(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue tanh(ASTNode value) throws SBMLException
value - SBMLExceptionASTNodeValue times(java.util.List<ASTNode> values) throws SBMLException
ASTNodes.values - These values must be interpretable to Number.SBMLExceptionASTNodeValue uMinus(ASTNode value) throws SBMLException
ASTNode.value - SBMLExceptionASTNodeValue unknownValue() throws SBMLException
ASTNode.SBMLExceptionASTNodeValue xor(java.util.List<ASTNode> values) throws SBMLException
values - It must be possible to evaluate the given values to
Boolean.SBMLException