Interface Expression
- All Superinterfaces:
Serializable
,TetradSerializable
- All Known Implementing Classes:
ConstantExpression
,EvaluationExpression
,VariableExpression
Represents a mathematical expression. Used in the Calculator and the Generalized Sem model.
Note that expressions form trees. Each expression has a (possibly empty) list of children.
- Version:
- $Id: $Id
- Author:
- Tyler Gibson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
ConstantserialVersionUID=23L
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Evaluates the expression using the given contextgetExpressions.org.apache.commons.math3.distribution.IntegerDistribution
getIntegerDistribution
(Context context) getIntegerDistribution.getPosition.org.apache.commons.math3.distribution.RealDistribution
getRealDistribution
(Context context) getRealDistribution.getToken()
getToken.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDConstantserialVersionUID=23L
- See Also:
-
-
Method Details
-
evaluate
Evaluates the expression using the given context- Parameters:
context
- aContext
object- Returns:
- a double
-
getToken
String getToken()getToken.
- Returns:
- the token for this expression=="+".
-
getPosition
ExpressionDescriptor.Position getPosition()getPosition.
- Returns:
- the position, infix or not.
-
getExpressions
List<Expression> getExpressions()getExpressions.
- Returns:
- the sub expressions of this expression.
-
getRealDistribution
getRealDistribution.
- Parameters:
context
- aContext
object- Returns:
- a
RealDistribution
object
-
getIntegerDistribution
getIntegerDistribution.
- Parameters:
context
- aContext
object- Returns:
- a
IntegerDistribution
object
-