|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--gpsys.Gene
A Gene is a node in a GP tree. A Gene can be either a function or a terminal, hence this abstract class has been subclassed to GeneFunction and GeneTerminal which are actually used.
| Field Summary | |
Primitive |
p
The primitive associated with this Gene which is either a Function or a Terminal. |
| Constructor Summary | |
Gene()
|
|
| Method Summary | |
abstract int |
complexity()
Calculates the number of nodes (Genes) in the subtree starting at this node (Gene). |
abstract Gene |
deepClone()
Makes a deep clone of this Gene, i.e. |
abstract int |
depth()
Calculates the maximum depth of the subtree starting at this node (Gene). |
abstract boolean |
evaluateBoolean(Individual i)
Evaluate this Gene as a Gene that returns a boolean when evaluated. |
abstract byte |
evaluateByte(Individual i)
Evaluate this Gene as a Gene that returns a byte when evaluated. |
abstract char |
evaluateChar(Individual i)
Evaluate this Gene as a Gene that returns a char when evaluated. |
abstract double |
evaluateDouble(Individual i)
Evaluate this Gene as a Gene that returns a double when evaluated. |
abstract float |
evaluateFloat(Individual i)
Evaluate this Gene as a Gene that returns a float when evaluated. |
abstract int |
evaluateInt(Individual i)
Evaluate this Gene as a Gene that returns a int when evaluated. |
abstract long |
evaluateLong(Individual i)
Evaluate this Gene as a Gene that returns a long when evaluated. |
abstract java.lang.Object |
evaluateObject(Individual i)
Evaluate this Gene as a Gene that returns an Object when evaluated. |
abstract short |
evaluateShort(Individual i)
Evaluate this Gene as a Gene that returns a short when evaluated. |
abstract java.lang.String |
toString()
Converts the Gene and its subtrees into a String. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public Primitive p
| Constructor Detail |
public Gene()
| Method Detail |
public abstract int complexity()
public abstract int depth()
public abstract java.lang.Object evaluateObject(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract byte evaluateByte(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract short evaluateShort(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract int evaluateInt(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract long evaluateLong(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract float evaluateFloat(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract double evaluateDouble(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract char evaluateChar(Individual i)
throws EvaluationException
i - the Individual being evaluated.
public abstract boolean evaluateBoolean(Individual i)
throws EvaluationException
i - the Individual being evaluated.public abstract Gene deepClone()
public abstract java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||