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

Variable Index

 o gpParameters
The GPParameters used to create this chromosome
 o treeTop
The Gene at the top of the tree.

Method Index

 o complexity()
Calculates the number of nodes in the Gene tree of this Chromosome.
 o cross(Chromosome, Chromosome)
Creates a new child Chromosome via crossover of the mother and father Chromosomes.
 o deepClone()
Makes a deep copy of this Chromsome by making a copy of the entire data graph.
 o evaluateBoolean(Individual)
Evaluates the chromosome so that it returns a boolean.
 o evaluateByte(Individual)
Evaluates the chromosome so that it returns a byte.
 o evaluateChar(Individual)
Evaluates the chromosome so that it returns a char.
 o evaluateDouble(Individual)
Evaluates the chromosome so that it returns a double.
 o evaluateFloat(Individual)
Evaluates the chromosome so that it returns a float.
 o evaluateInt(Individual)
Evaluates the chromosome so that it returns an int.
 o evaluateLong(Individual)
Evaluates the chromosome so that it returns a long.
 o evaluateObject(Individual)
Evaluates the chromosome so that it returns an Object reference.
 o evaluateShort(Individual)
Evaluates the chromosome so that it returns a byte.
 o mutate(Chromosome)
Creates a new child Chromosome which is a mutation of the mother.
 o toString()
Generates a String representing a dump of the Gene tree for this Chromosome.

Variables

 o treeTop
 public Gene treeTop
The Gene at the top of the tree. this gene is evaulated when this ADF needs evaluation

See Also:
Gene
 o gpParameters
 public GPParameters gpParameters
The GPParameters used to create this chromosome

See Also:
GPParameters

Methods

 o 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
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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