All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpsys.GeneTerminal

java.lang.Object
   |
   +----gpsys.Gene
           |
           +----gpsys.GeneTerminal

public class GeneTerminal
extends Gene
implements Cloneable
A GeneTerminal is a leaf in a Gene tree and represents a Terminal.

Version:
1.1, 30th June '97
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.

Method Index

 o complexity()
Get the number of Genes in this Gene.
 o deepClone()
Make a clone of this Gene.
 o depth()
Calculate the maximum depth of this Gene.
 o evaluateBoolean(Individual)
Evaluate this Gene as Terminal returning a boolean.
 o evaluateByte(Individual)
Evaluate this Gene as Terminal returning a byte.
 o evaluateChar(Individual)
Evaluate this Gene as Terminal returning a char.
 o evaluateDouble(Individual)
Evaluate this Gene as Terminal returning a double.
 o evaluateFloat(Individual)
Evaluate this Gene as Terminal returning a float.
 o evaluateInt(Individual)
Evaluate this Gene as Terminal returning an int.
 o evaluateLong(Individual)
Evaluate this Gene as Terminal returning a long.
 o evaluateObject(Individual)
Evaluate this Gene as Terminal returning an Object reference.
 o evaluateShort(Individual)
Evaluate this Gene as Terminal returning a short.
 o toString()
Create a String representing this Gene.

Methods

 o evaluateObject
 public Object evaluateObject(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateByte
 public byte evaluateByte(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateShort
 public short evaluateShort(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateInt
 public int evaluateInt(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateLong
 public long evaluateLong(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateFloat
 public float evaluateFloat(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateDouble
 public double evaluateDouble(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateChar
 public char evaluateChar(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o evaluateBoolean
 public boolean evaluateBoolean(Individual i) throws EvaluationException
Evaluate this Gene as Terminal 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
 o depth
 public int depth()
Calculate the maximum depth of this Gene. The result is always one since this Gene represents a Terminal.

Returns:
1, this the depth of any Terminal.
Overrides:
depth in class Gene
 o complexity
 public int complexity()
Get the number of Genes in this Gene.

Returns:
1, since it represents a Terminal.
Overrides:
complexity in class Gene
 o deepClone
 public Gene deepClone()
Make a clone of this Gene.

Returns:
a clone of this Gene.
Overrides:
deepClone in class Gene
 o toString
 public String toString()
Create a String representing this Gene.

Returns:
a String representing this tree.
Overrides:
toString in class Gene

All Packages  Class Hierarchy  This Package  Previous  Next  Index