All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.Fitness
java.lang.Object
|
+----gpsys.Fitness
- public abstract class Fitness
- extends Object
- implements Serializable
Represents the fitness of an individual. This class must be
subclassed to define the fitness measure for your application.
- Version:
- 1.1, 30th June '97
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
-
Fitness()
-
-
add(Fitness)
- Add a fitness value to this fitness value.
-
divide(int)
- Divide the fitness by the specified integer.
-
equals(Fitness)
- Tests if this fitness is equal to another fitness.
-
greaterThan(Fitness)
- Tests if this fitness value is greater than another fitness value.
-
instance()
- Creates a new instance of the Fitness object with a default fitness.
-
instance(GPParameters, Individual)
- Creates a new instance of the Fitness object which represents the
fitness of the specified individual.
-
lessThan(Fitness)
- Tests if this fitness is less than another fitness.
-
terminationCondition()
- Tests whether this fitness meets the termination criteria.
-
toString()
- Converts the fitness into a String suitable for printing.
Fitness
public Fitness()
add
public abstract void add(Fitness f)
- Add a fitness value to this fitness value.
- Parameters:
- f - the fitness value to be added.
divide
public abstract void divide(int divisor)
- Divide the fitness by the specified integer. This is used by the
GP system to calculate the average fitness of the population.
- Parameters:
- divisor - the integer to divide the fitness by.
equals
public abstract boolean equals(Fitness f)
- Tests if this fitness is equal to another fitness.
- Parameters:
- f - the fitness with which to compare.
- Returns:
- true if f has the same fitness, false otherwise.
lessThan
public abstract boolean lessThan(Fitness f)
- Tests if this fitness is less than another fitness.
- Parameters:
- f - the fitness with which to compare.
- Returns:
- true if f has less fitness, false otherwise.
greaterThan
public abstract boolean greaterThan(Fitness f)
- Tests if this fitness value is greater than another fitness value.
- Parameters:
- f - the fitness with which to compare.
- Returns:
- true if f has higher fitness, false otherwise.
instance
public abstract Fitness instance()
- Creates a new instance of the Fitness object with a default fitness.
- Returns:
- an instance of a Fitness object with default fitness.
instance
public abstract Fitness instance(GPParameters gpParameters,
Individual i)
- Creates a new instance of the Fitness object which represents the
fitness of the specified individual.
- Parameters:
- gpParameters - the parameters for this GP run.
- i - the individual to be evaluated.
- Returns:
- The Fitness of the specified individual.
terminationCondition
public abstract boolean terminationCondition()
- Tests whether this fitness meets the termination criteria.
- Returns:
- true if the termination criteria has been met, false otherwise.
toString
public abstract String toString()
- Converts the fitness into a String suitable for printing.
- Returns:
- A String representing the fitness.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index