Interface ELExpression

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
AbstractELExpression, ELCall, ELMorphInterpolator, ELScalar, ELVector

public interface ELExpression
extends java.lang.Cloneable

A symbolic expression in the EL language. An expression "contains" all of its subexpressions. An expression can appear in exactly one other expression; they are never shared between expressions. An expression cannot be mutated (to allow future expansion to expression sharing).


 ELExpression := ELCall | ELScalar | ELVector
 ELCall := (ELOperator ELExpression*)


Method Summary
 java.lang.Object clone()
           
 ELExpression cloneWithReplacement(ELExpression expression, int position)
          Creates a perfect clone with expression substitited for node at position.
 void evaluate(ELMatrix out, ELEnvironment environment)
          Evaluates this expression.
 ELExpression geneticClone(ELCall parent, GeneticParameters gp)
          Clones, possibly mutating.
 ELExpression getNestedSubexpression(int targetNumber)
           
 boolean hasExternalInfluences()
          Returns true if the output is influenced by the environment.
 int numNestedSubexpressions()
          The total number of nodes (including this one) below this expression.
 ELExpression randomNestedSubexpression()
          Chooses a nested subexpression of this expression (possibly the expression itself) and returns a pointer to it (not a clone)
 boolean sameExpression(ELExpression other)
          Return true if this and other are equivalent expressions (unparse to the same value).
 java.lang.String unparse()
          Generates an EL language source string sufficient to uniquely identify this expression.
 

Method Detail

numNestedSubexpressions

public int numNestedSubexpressions()
The total number of nodes (including this one) below this expression. For example: Noise() -> 1, Add(X(), Y()) -> 3.

geneticClone

public ELExpression geneticClone(ELCall parent,
                                 GeneticParameters gp)
Clones, possibly mutating. The operators will be shared between clones but no ELExpressions will be shared.
Parameters:
parent - Parent expression from previous generation. don't point at or mutate this; it is provided so you can get access to siblings. May be null if there is no parent (i.e. top-level expression).

hasExternalInfluences

public boolean hasExternalInfluences()
Returns true if the output is influenced by the environment.

cloneWithReplacement

public ELExpression cloneWithReplacement(ELExpression expression,
                                         int position)
Creates a perfect clone with expression substitited for node at position.
Parameters:
expression - Is not cloned.

randomNestedSubexpression

public ELExpression randomNestedSubexpression()
Chooses a nested subexpression of this expression (possibly the expression itself) and returns a pointer to it (not a clone)

getNestedSubexpression

public ELExpression getNestedSubexpression(int targetNumber)

unparse

public java.lang.String unparse()
Generates an EL language source string sufficient to uniquely identify this expression.

sameExpression

public boolean sameExpression(ELExpression other)
Return true if this and other are equivalent expressions (unparse to the same value).

evaluate

public void evaluate(ELMatrix out,
                     ELEnvironment environment)
Evaluates this expression.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object