org.generation5.bio
Interface Evolvable

All Superinterfaces:
java.lang.Comparable
All Known Implementing Classes:
EvoFeedForwardNN, EvolveStandard, EvoTravellingSalesman

public interface Evolvable
extends java.lang.Comparable

This interface allows any class to be evolvable by GeneticAlgorithm. It is derived from Comparable so they classes can be efficiently sorted by the GA. Invariably, this is done by fitness.


Method Summary
 void calculateFitness()
          Calculate the fitness of this object.
 double getFitness()
          Return the fitness of this object.
 Evolvable mate(Evolvable partner)
          Mate with another Evolvable type.
 void mutate()
          Mutate the class data.
 void randomInitialize()
          Initialize the class to random values.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

randomInitialize

public void randomInitialize()
Initialize the class to random values. This allows for a default constructor or initializor, as well as the random initializor required for the genetic algorithm.


mutate

public void mutate()
Mutate the class data.


mate

public Evolvable mate(Evolvable partner)
Mate with another Evolvable type. It is entirely up to the class implementator how to implement the mating; one-point, two-point crossover etc.

Parameters:
partner - the other mate.
Returns:
the child of this and partner.

calculateFitness

public void calculateFitness()
Calculate the fitness of this object.


getFitness

public double getFitness()
Return the fitness of this object.

Returns:
the fitness.

This documentation is part of the Generation5 JDK.