Interface Expression

All Superinterfaces:
Serializable, TetradSerializable
All Known Implementing Classes:
ConstantExpression, EvaluationExpression, VariableExpression

public interface Expression extends TetradSerializable
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 Details

    • serialVersionUID

      static final long serialVersionUID
      Constant serialVersionUID=23L
      See Also:
  • Method Details

    • evaluate

      double evaluate(Context context)
      Evaluates the expression using the given context
      Parameters:
      context - a Context object
      Returns:
      a double
    • getToken

      String getToken()

      getToken.

      Returns:
      the token for this expression=="+".
    • getPosition

      getPosition.

      Returns:
      the position, infix or not.
    • getExpressions

      List<Expression> getExpressions()

      getExpressions.

      Returns:
      the sub expressions of this expression.
    • getRealDistribution

      org.apache.commons.math3.distribution.RealDistribution getRealDistribution(Context context)

      getRealDistribution.

      Parameters:
      context - a Context object
      Returns:
      a RealDistribution object
    • getIntegerDistribution

      org.apache.commons.math3.distribution.IntegerDistribution getIntegerDistribution(Context context)

      getIntegerDistribution.

      Parameters:
      context - a Context object
      Returns:
      a IntegerDistribution object