All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.Gene
java.lang.Object
|
+----gpsys.Gene
- public abstract class Gene
- extends Object
- implements Serializable
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.
- Version:
- 1.1, 30th June '97
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
-
p
- The primitive associated with this Gene which is either a Function or a
Terminal.
-
Gene()
-
-
complexity()
- Calculates the number of nodes (Genes) in the subtree starting at this
node (Gene).
-
deepClone()
- Makes a deep clone of this Gene, i.e.
-
depth()
- Calculates the maximum depth of the subtree starting at this node (Gene).
-
evaluateBoolean(Individual)
- Evaluate this Gene as a Gene that returns a boolean when evaluated.
-
evaluateByte(Individual)
- Evaluate this Gene as a Gene that returns a byte when evaluated.
-
evaluateChar(Individual)
- Evaluate this Gene as a Gene that returns a char when evaluated.
-
evaluateDouble(Individual)
- Evaluate this Gene as a Gene that returns a double when evaluated.
-
evaluateFloat(Individual)
- Evaluate this Gene as a Gene that returns a float when evaluated.
-
evaluateInt(Individual)
- Evaluate this Gene as a Gene that returns a int when evaluated.
-
evaluateLong(Individual)
- Evaluate this Gene as a Gene that returns a long when evaluated.
-
evaluateObject(Individual)
- Evaluate this Gene as a Gene that returns an Object when evaluated.
-
evaluateShort(Individual)
- Evaluate this Gene as a Gene that returns a short when evaluated.
-
toString()
- Converts the Gene and its subtrees into a String.
p
public Primitive p
- The primitive associated with this Gene which is either a Function or a
Terminal.
Gene
public Gene()
complexity
public abstract int complexity()
- Calculates the number of nodes (Genes) in the subtree starting at this
node (Gene).
depth
public abstract int depth()
- Calculates the maximum depth of the subtree starting at this node (Gene).
evaluateObject
public abstract Object evaluateObject(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns an Object when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- An Object which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateByte
public abstract byte evaluateByte(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a byte when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A byte which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateShort
public abstract short evaluateShort(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a short when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A short which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateInt
public abstract int evaluateInt(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a int when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A int which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateLong
public abstract long evaluateLong(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a long when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A long which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateFloat
public abstract float evaluateFloat(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a float when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A float which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateDouble
public abstract double evaluateDouble(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a double when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A double which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateChar
public abstract char evaluateChar(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a char when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A char which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateBoolean
public abstract boolean evaluateBoolean(Individual i) throws EvaluationException
- Evaluate this Gene as a Gene that returns a boolean when evaluated.
- Parameters:
- i - the Individual being evaluated.
- Returns:
- A boolean which is the evaluation result.
- Throws: EvaluationException
- If there is an evaluation failure.
deepClone
public abstract Gene deepClone()
- Makes a deep clone of this Gene, i.e. the Gene and all of it's subtrees.
- Returns:
- A clone of the Gene and its subtrees.
toString
public abstract String toString()
- Converts the Gene and its subtrees into a String.
- Returns:
- A String representing the Gene and any subtrees.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index