All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.Chromosome
java.lang.Object
|
+----gpsys.Chromosome
- public class Chromosome
- extends Object
- implements Cloneable, Serializable
A Chromosome defines an evolvable gene tree.
- Version:
- 1.1, 30th June '97
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
- See Also:
- Terminal
-
gpParameters
- The GPParameters used to create this chromosome
-
treeTop
- The Gene at the top of the tree.
-
complexity()
- Calculates the number of nodes in the Gene tree of this Chromosome.
-
cross(Chromosome, Chromosome)
- Creates a new child Chromosome via crossover of the mother and father
Chromosomes.
-
deepClone()
- Makes a deep copy of this Chromsome by making a copy of the entire
data graph.
-
evaluateBoolean(Individual)
- Evaluates the chromosome so that it returns a boolean.
-
evaluateByte(Individual)
- Evaluates the chromosome so that it returns a byte.
-
evaluateChar(Individual)
- Evaluates the chromosome so that it returns a char.
-
evaluateDouble(Individual)
- Evaluates the chromosome so that it returns a double.
-
evaluateFloat(Individual)
- Evaluates the chromosome so that it returns a float.
-
evaluateInt(Individual)
- Evaluates the chromosome so that it returns an int.
-
evaluateLong(Individual)
- Evaluates the chromosome so that it returns a long.
-
evaluateObject(Individual)
- Evaluates the chromosome so that it returns an Object reference.
-
evaluateShort(Individual)
- Evaluates the chromosome so that it returns a byte.
-
mutate(Chromosome)
- Creates a new child Chromosome which is a mutation of the mother.
-
toString()
- Generates a String representing a dump of the Gene tree for this
Chromosome.
treeTop
public Gene treeTop
- The Gene at the top of the tree.
this gene is evaulated when this ADF needs evaluation
- See Also:
- Gene
gpParameters
public GPParameters gpParameters
- The GPParameters used to create this chromosome
- See Also:
- GPParameters
mutate
public static Chromosome mutate(Chromosome mum)
- Creates a new child Chromosome which is a mutation of the mother.
- Parameters:
- mum - is the mother Chromosome.
- Returns:
- a reference to a child Chromosome which is a mutation of
the mother
cross
public static Chromosome cross(Chromosome mum,
Chromosome dad)
- Creates a new child Chromosome via crossover of the mother and father
Chromosomes.
- Parameters:
- mum - is the mother Chromosome. The child is actually a copy
of the mother with one branch exchanged with a branch from
the father.
- dad - is the father Chromosome.
- Returns:
- a reference to a new child Chromosome.
deepClone
public Chromosome deepClone()
- Makes a deep copy of this Chromsome by making a copy of the entire
data graph.
- Returns:
- a reference to a copy of this Chromosome.
complexity
public int complexity()
- Calculates the number of nodes in the Gene tree of this Chromosome.
- Returns:
- the number of nodes in the Gene tree.
evaluateObject
public Object evaluateObject(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns an Object reference.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a reference to an Object returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateByte
public byte evaluateByte(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a byte.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a byte returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateShort
public short evaluateShort(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a byte.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a byte returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateInt
public int evaluateInt(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns an int.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- an int returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateLong
public long evaluateLong(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a long.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a long returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateFloat
public float evaluateFloat(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a float.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a float returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateDouble
public double evaluateDouble(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a double.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a double returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateChar
public char evaluateChar(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a char.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a char returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
evaluateBoolean
public boolean evaluateBoolean(Individual i) throws EvaluationException
- Evaluates the chromosome so that it returns a boolean.
- Parameters:
- i - is the Individual being evaluated.
- Returns:
- a boolean returned by evaluating the Gene tree.
- Throws: EvaluationException
- If there is an evaluation failure.
toString
public String toString()
- Generates a String representing a dump of the Gene tree for this
Chromosome.
- Returns:
- a String representing the Gene tree for this Chromosome.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index