All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpsys.Individual

java.lang.Object
   |
   +----gpsys.Individual

public class Individual
extends Object
implements Serializable
An Individual is an evolved GP program. It consists of a number of Chromosomes (which are automatically defined functions). An Individual has fitness which measures the suitability of the Individual for solving the problem for which it was evolved.

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

Variable Index

 o adf
An Individual has a number of Chromosomes.
 o complexity
The total number of Genes used across all Chromosomes.
 o fitness
An Individual has Fitness which is a measure of the suitability of the for solving the problem for which it was evolved.

Constructor Index

 o Individual(GPParameters)
Create a completely new Individual.
 o Individual(GPParameters, Individual)
Create a new Individual which is a mutation of the mother.
 o Individual(GPParameters, Individual, Individual)
Create a new Individual via sexual reproduction (crossover).

Method Index

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

Variables

 o adf
 public Chromosome adf[]
An Individual has a number of Chromosomes. The chromosome are Gene trees representing automatically defined functions.

 o fitness
 public Fitness fitness
An Individual has Fitness which is a measure of the suitability of the for solving the problem for which it was evolved.

 o complexity
 public int complexity
The total number of Genes used across all Chromosomes.

Constructors

 o Individual
 public Individual(GPParameters gpParameters)
Create a completely new Individual. This method creates Gene trees for each Chromosome (ADF), and then evaluates the individual's fitness.

Parameters:
gpParameters - the problem specific parameters.
 o Individual
 public Individual(GPParameters gpParameters,
                   Individual mum)
Create a new Individual which is a mutation of the mother. The mother is cloned, and the clone mutated to produce the child. Mutation involves replacing one random subtree in each Chromosome (ADF) with newly created type compatible one.

Parameters:
gpParameters - the problem specific parameters.
mum - the mother.
 o Individual
 public Individual(GPParameters gpParameters,
                   Individual mum,
                   Individual dad)
Create a new Individual via sexual reproduction (crossover). The mother is cloned and the clone is crossed with the father to create the child.

Parameters:
gpParameters - the problem specific parameters.
mum - the mother.
dad - the father.

Methods

 o evaluateObject
 public Object evaluateObject() throws EvaluationException
Evaluate this Individual as a program returning an Object reference. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
An Object which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateByte
 public byte evaluateByte() throws EvaluationException
Evaluate this Individual as a program returning a byte. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
A byte which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateShort
 public short evaluateShort() throws EvaluationException
Evaluate this Individual as a program returning a short. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
A short which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateInt
 public int evaluateInt() throws EvaluationException
Evaluate this Individual as a program returning an int. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
An int which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateLong
 public long evaluateLong() throws EvaluationException
Evaluate this Individual as a program returning a long. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0]. # @return A long which is the result of the evaluation.

Throws: EvaluationException
If there is an evaluation failure.
 o evaluateFloat
 public float evaluateFloat() throws EvaluationException
Evaluate this Individual as a program returning a float. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
A float which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateDouble
 public double evaluateDouble() throws EvaluationException
Evaluate this Individual as a program returning a double. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
A double which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateChar
 public char evaluateChar() throws EvaluationException
Evaluate this Individual as a program returning a char. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
A char which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o evaluateBoolean
 public boolean evaluateBoolean() throws EvaluationException
Evaluate this Individual as a program returning a boolean. An Individual is evaluated by evaluating the root (or result producing Chromosome) which is alway assumed to adf[0].

Returns:
A boolean which is the result of the evaluation.
Throws: EvaluationException
If there is an evaluation failure.
 o complexity
 public int complexity()
Get the total number of Genes in this Individual.

Returns:
the number Genes in the Individual.
 o toString
 public String toString()
Create a String representing this Individual.

Returns:
A String representing this Individual.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index