|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ec.gp.GPTree
GPTree is a GPNodeParent which holds the root GPNode of a tree of GPNodes. GPTrees typically fill out an array held in a GPIndividual (their "owner") and their roots are evaluated to evaluate a Genetic programming tree. GPTrees also have constraints, which are shared, and define items shared among several GPTrees.
Parameters
base.tc String |
(The tree's constraints) |
Default Base
gp.tree
Field Summary | |
GPNode |
child
the root GPNode in the GPTree |
byte |
constraints
constraints on the GPTree -- don't access the constraints through this variable -- use the constraints() method instead, which will give the actual constraints object. |
static int |
NO_TREENUM
|
GPIndividual |
owner
the owner of the GPTree |
static java.lang.String |
P_TREE
|
static java.lang.String |
P_TREECONSTRAINTS
|
Constructor Summary | |
GPTree()
|
Method Summary | |
void |
buildTree(EvolutionState state,
int thread)
Builds a new randomly-generated rooted tree and attaches it to the GPTree. |
GPTreeConstraints |
constraints()
|
Parameter |
defaultBase()
Returns the default base for this prototype. |
void |
printTree(EvolutionState state,
int log,
int verbosity)
Prints out the tree in single-line fashion suitable for reading in later by computer. |
void |
printTree(EvolutionState state,
int thread,
java.io.PrintWriter writer)
Prints out the tree in single-line fashion suitable for reading in later by computer. |
void |
printTreeForHumans(EvolutionState state,
int log,
int verbosity)
Prints out the tree in a readable Lisp-like fashion. |
java.lang.Object |
protoClone()
Proto-clones the tree but does NOT deep clone it. |
java.lang.Object |
protoCloneSimple()
This should be implemented in a the top-level Prototype ONLY; in fact, it should probably be declared final. |
void |
readTree(EvolutionState state,
int thread,
java.io.LineNumberReader reader)
Reads in the tree from a form printed by printTree. |
void |
setup(EvolutionState state,
Parameter base)
Sets up a prototypical GPTree with those features it shares with other GPTrees in its position in its GPIndividual, and nothhing more. |
boolean |
treeEquals(GPTree tree)
Returns true if I am "genetically" the same as tree, though we may have different owners. |
int |
treeHashCode()
Returns a hash code for comparing different GPTrees. |
int |
treeNumber()
An expensive function which determines my tree number -- only use for errors, etc. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String P_TREE
public static final java.lang.String P_TREECONSTRAINTS
public static final int NO_TREENUM
public GPNode child
public GPIndividual owner
public byte constraints
Constructor Detail |
public GPTree()
Method Detail |
public final GPTreeConstraints constraints()
public Parameter defaultBase()
public boolean treeEquals(GPTree tree)
public int treeHashCode()
public java.lang.Object protoClone() throws java.lang.CloneNotSupportedException
public final java.lang.Object protoCloneSimple()
public final Object protoCloneSimple()
{
try { return protoClone(); }
catch (CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
}
public int treeNumber()
public void setup(EvolutionState state, Parameter base)
public void printTree(EvolutionState state, int log, int verbosity)
public void printTree(EvolutionState state, int thread, java.io.PrintWriter writer)
public void readTree(EvolutionState state, int thread, java.io.LineNumberReader reader) throws java.io.IOException, java.lang.CloneNotSupportedException
public void printTreeForHumans(EvolutionState state, int log, int verbosity)
public void buildTree(EvolutionState state, int thread) throws java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |