All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.GeneFunction
java.lang.Object
|
+----gpsys.Gene
|
+----gpsys.GeneFunction
- public abstract class GeneFunction
- extends Gene
- implements Cloneable
A GeneFunction is a Gene tree representing a function call. A GeneFunction
therefore has Gene arguments (branches or subtrees).
- Version:
- 1.1, 30th June '97
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
- See Also:
- Gene, GeneFunctionGrow, GeneFunctionFull
-
GeneFunction()
-
-
complexity()
- Get the number of Genes in this Gene tree.
-
deepClone()
- Make a clone of this Gene tree, cloning all subtrees.
-
depth()
- Get the maximum depth of this Gene tree
-
evaluateBoolean(Individual)
- Evaluate this Gene as Function returning a boolean.
-
evaluateByte(Individual)
- Evaluate this Gene as Function returning a byte.
-
evaluateChar(Individual)
- Evaluate this Gene as Function returning a char.
-
evaluateDouble(Individual)
- Evaluate this Gene as Function returning a double.
-
evaluateFloat(Individual)
- Evaluate this Gene as Function returning a float.
-
evaluateInt(Individual)
- Evaluate this Gene as Function returning an int.
-
evaluateLong(Individual)
- Evaluate this Gene as Function returning a long.
-
evaluateObject(Individual)
- Evaluate this Gene as Function returning an Object reference.
-
evaluateShort(Individual)
- Evaluate this Gene as Function returning a short.
-
toString()
- Create a String representing this Gene tree.
GeneFunction
public GeneFunction()
evaluateObject
public Object evaluateObject(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning an Object reference.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- An Object which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateObject in class Gene
evaluateByte
public byte evaluateByte(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a byte.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A byte which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateByte in class Gene
evaluateShort
public short evaluateShort(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a short.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A short which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateShort in class Gene
evaluateInt
public int evaluateInt(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning an int.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- An int which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateInt in class Gene
evaluateLong
public long evaluateLong(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a long.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A long which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateLong in class Gene
evaluateFloat
public float evaluateFloat(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a float.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A float which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateFloat in class Gene
evaluateDouble
public double evaluateDouble(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a double.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A double which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateDouble in class Gene
evaluateChar
public char evaluateChar(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a char.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A char which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateChar in class Gene
evaluateBoolean
public boolean evaluateBoolean(Individual i) throws EvaluationException
- Evaluate this Gene as Function returning a boolean.
- Parameters:
- i - the individual to which this Gene belongs
- Returns:
- A boolean which is the result of the evaluation.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateBoolean in class Gene
depth
public int depth()
- Get the maximum depth of this Gene tree
- Returns:
- the maximum depth of the tree.
- Overrides:
- depth in class Gene
complexity
public int complexity()
- Get the number of Genes in this Gene tree.
- Returns:
- the number of Genes in this Gene tree.
- Overrides:
- complexity in class Gene
deepClone
public Gene deepClone()
- Make a clone of this Gene tree, cloning all subtrees.
- Returns:
- a clone of this Gene.
- Overrides:
- deepClone in class Gene
toString
public String toString()
- Create a String representing this Gene tree.
- Returns:
- a String representing this tree.
- Overrides:
- toString in class Gene
All Packages Class Hierarchy This Package Previous Next Index