gpalta.core
Class Tree
java.lang.Object
gpalta.core.Individual
gpalta.core.Tree
- All Implemented Interfaces:
- NodeParent, java.io.Serializable, java.lang.Cloneable
public class Tree
- extends Individual
- implements NodeParent
The simplest individual: a function tree
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Tree
public Tree(NodeSet type)
- Creates a new instance of Tree
Tree
public Tree(java.lang.String expression,
NodeSet type,
NodeFactory nodeFactory)
eval
public Output eval(ProblemData problemData)
- Specified by:
eval
in class Individual
evalVect
public void evalVect(Output out,
TempVectorFactory tempVectorFactory,
ProblemData problemData)
- Specified by:
evalVect
in class Individual
nKids
public int nKids()
- Specified by:
nKids
in interface NodeParent
typeOfKids
public NodeSet typeOfKids(int whichKid)
- Specified by:
typeOfKids
in interface NodeParent
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
deepClone
public Individual deepClone()
- Description copied from class:
Individual
- Get a new, totally independent copy of this individual. Subclasses must implement this method
properly, in order to insure that two instances are not modified unintentionally
- Specified by:
deepClone
in class Individual
getSize
public int getSize()
- Description copied from class:
Individual
- Get the size of this Individual, hopefully without recalculating it (ie. in the case of a
Tree, without descending every node). In most cases, this will mean the number of nodes
present in the Individual
- Specified by:
getSize
in class Individual
getParent
public NodeParent getParent()
- Specified by:
getParent
in interface NodeParent
getNSubNodes
public int getNSubNodes()
- Specified by:
getNSubNodes
in interface NodeParent
setNSubNodes
public void setNSubNodes(int nSubNodes)
- Specified by:
setNSubNodes
in interface NodeParent
getKid
public Node getKid(int whichKid)
- Specified by:
getKid
in interface NodeParent
setKid
public void setKid(int whichKid,
Node kid)
- Specified by:
setKid
in interface NodeParent
getMaxDepthFromHere
public int getMaxDepthFromHere()
- Specified by:
getMaxDepthFromHere
in interface NodeParent
setMaxDepthFromHere
public void setMaxDepthFromHere(int maxDepthFromHere)
- Specified by:
setMaxDepthFromHere
in interface NodeParent
getCurrentDepth
public int getCurrentDepth()
- Specified by:
getCurrentDepth
in interface NodeParent
newKids
public void newKids()
- Specified by:
newKids
in interface NodeParent