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.
-
adf
- An Individual has a number of Chromosomes.
-
complexity
- The total number of Genes used across all Chromosomes.
-
fitness
- An Individual has Fitness which is a measure of the suitability of the
for solving the problem for which it was evolved.
-
Individual(GPParameters)
- Create a completely new Individual.
-
Individual(GPParameters, Individual)
- Create a new Individual which is a mutation of the mother.
-
Individual(GPParameters, Individual, Individual)
- Create a new Individual via sexual reproduction (crossover).
-
complexity()
- Get the total number of Genes in this Individual.
-
evaluateBoolean()
- Evaluate this Individual as a program returning a boolean.
-
evaluateByte()
- Evaluate this Individual as a program returning a byte.
-
evaluateChar()
- Evaluate this Individual as a program returning a char.
-
evaluateDouble()
- Evaluate this Individual as a program returning a double.
-
evaluateFloat()
- Evaluate this Individual as a program returning a float.
-
evaluateInt()
- Evaluate this Individual as a program returning an int.
-
evaluateLong()
- Evaluate this Individual as a program returning a long.
-
evaluateObject()
- Evaluate this Individual as a program returning an Object reference.
-
evaluateShort()
- Evaluate this Individual as a program returning a short.
-
toString()
- Create a String representing this Individual.
adf
public Chromosome adf[]
- An Individual has a number of Chromosomes. The chromosome are Gene
trees representing automatically defined functions.
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.
complexity
public int complexity
- The total number of Genes used across all Chromosomes.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
complexity
public int complexity()
- Get the total number of Genes in this Individual.
- Returns:
- the number Genes in the Individual.
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