Class ELCall

java.lang.Object
  |
  +--AbstractELExpression
        |
        +--ELCall
All Implemented Interfaces:
java.lang.Cloneable, ELExpression

public class ELCall
extends AbstractELExpression
implements ELExpression

An operator expression.


Field Summary
(package private)  boolean _hasExternalInfluences
           
(package private)  ELExpression[] child
           
(package private)  int complexityScore
           
(package private)  ELOperator operator
           
 
Constructor Summary
protected ELCall(ELOperator operator, ELExpression[] subExpressions)
           
 
Method Summary
 java.lang.Object clone()
           
protected  ELExpression cloneWithChildMutations(GeneticParameters gp)
          Clone, genetically cloning children but perfectly cloning this expression itself.
 ELExpression cloneWithReplacement(ELExpression e, int p)
          Creates a perfect clone with expression substitited for node at position.
 int depth()
          Returns the maximum depth of this expression, where depth is the maximum number of expressions enclosing a subexpression.
 void evaluate(ELMatrix out, ELEnvironment environment)
          Evaluates this expression.
 ELExpression geneticClone(ELCall parent, GeneticParameters gp)
          Clones, possibly mutating.
 ELExpression getNestedSubexpression(int targetNumber)
          Returns a nested subexpression.
 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.
 int numSubexpressions()
          Returns the number of sub expressions (formal parameters) in this call.
(package private)  ELExpression randomChild()
          Randomly chooses a child expression and returns it.
 ELExpression randomSubexpression()
           
 java.lang.String toString()
           
 java.lang.String unparse()
          Generates an EL language source string sufficient to uniquely identify this expression.
 
Methods inherited from class AbstractELExpression
cloneSiblingMutation, encloseInNewCallMutation, randomNestedSubexpression, sameExpression
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ELExpression
randomNestedSubexpression, sameExpression
 

Field Detail

operator

ELOperator operator

child

ELExpression[] child

complexityScore

int complexityScore

_hasExternalInfluences

boolean _hasExternalInfluences
Constructor Detail

ELCall

protected ELCall(ELOperator operator,
                 ELExpression[] subExpressions)
Parameters:
subExpressions - array is used directly, not cloned.
Method Detail

hasExternalInfluences

public boolean hasExternalInfluences()
Description copied from interface: ELExpression
Returns true if the output is influenced by the environment.
Specified by:
hasExternalInfluences in interface ELExpression
Overrides:
hasExternalInfluences in class AbstractELExpression

geneticClone

public ELExpression geneticClone(ELCall parent,
                                 GeneticParameters gp)
Description copied from interface: ELExpression
Clones, possibly mutating. The operators will be shared between clones but no ELExpressions will be shared.
Specified by:
geneticClone in interface ELExpression
Following copied from interface: ELExpression
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).

cloneWithReplacement

public ELExpression cloneWithReplacement(ELExpression e,
                                         int p)
Description copied from interface: ELExpression
Creates a perfect clone with expression substitited for node at position.
Specified by:
cloneWithReplacement in interface ELExpression
Overrides:
cloneWithReplacement in class AbstractELExpression
Following copied from interface: ELExpression
Parameters:
expression - Is not cloned.

numSubexpressions

public int numSubexpressions()
Returns the number of sub expressions (formal parameters) in this call.

cloneWithChildMutations

protected ELExpression cloneWithChildMutations(GeneticParameters gp)
Description copied from class: AbstractELExpression
Clone, genetically cloning children but perfectly cloning this expression itself. The default implementation of encloseInNewCallMutation calls this method.
Overrides:
cloneWithChildMutations in class AbstractELExpression

randomChild

ELExpression randomChild()
Randomly chooses a child expression and returns it. Don't mutate the result.

unparse

public java.lang.String unparse()
Description copied from interface: ELExpression
Generates an EL language source string sufficient to uniquely identify this expression.
Specified by:
unparse in interface ELExpression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

numNestedSubexpressions

public int numNestedSubexpressions()
Description copied from interface: ELExpression
The total number of nodes (including this one) below this expression. For example: Noise() -> 1, Add(X(), Y()) -> 3.
Specified by:
numNestedSubexpressions in interface ELExpression
Overrides:
numNestedSubexpressions in class AbstractELExpression

randomSubexpression

public ELExpression randomSubexpression()

getNestedSubexpression

public ELExpression getNestedSubexpression(int targetNumber)
Returns a nested subexpression. Subexpressions are numbered from the root in a depth first manner.
Specified by:
getNestedSubexpression in interface ELExpression
Overrides:
getNestedSubexpression in class AbstractELExpression
Parameters:
targetNumber - The number of the node we're looking for. The root is zero.

evaluate

public void evaluate(ELMatrix out,
                     ELEnvironment environment)
Description copied from interface: ELExpression
Evaluates this expression.
Specified by:
evaluate in interface ELExpression

clone

public java.lang.Object clone()
Specified by:
clone in interface ELExpression
Overrides:
clone in class AbstractELExpression

depth

public int depth()
Returns the maximum depth of this expression, where depth is the maximum number of expressions enclosing a subexpression. A scalar, vector, or procedure with no subexpressions has depth 0.