#include <GeneticEngine.h>
Inheritance diagram for prapi::ga::CrossingOverBreeder< T >:

Public Methods | |
| CrossingOverBreeder (double selectionProbability=0.25, double rate=0.8) | |
| Create a new CrossingOverBreeder with the given parent selection probability and selection rate. | |
| virtual void | createChildren (const util::List< Individual< T > > &from, util::List< Individual< T > > &to) |
| Select parentSelectionRate/2*from.getLength() pairs of parents and breed them producing two children for each pair. | |
| virtual util::List< Individual< T > > | mate (const Individual< T > &parent1, const Individual< T > &parent2) |
| Mate two individuals and produce some offspring. | |
Public Attributes | |
| double | parentSelectionProbability |
| A value in the range [0,1] that tells how probable it is for the fittest individual to get selected for mating first. | |
| double | parentSelectionRate |
| A value in the range [0,1] that tells how large fraction of the population is selected for mating. | |
|
||||||||||||||||
|
Create a new CrossingOverBreeder with the given parent selection probability and selection rate. If you are using a RankSelector or similar, you need to make sure that the selection rates of these objects sum up to unity. Otherwise your population will either shrink or grow. |
|
||||||||||||||||
|
Select parentSelectionRate/2*from.getLength() pairs of parents and breed them producing two children for each pair. Parents are selected using a rank selection method.
Implements prapi::ga::Breeder< T >. |
|
||||||||||||||||
|
Mate two individuals and produce some offspring. This implementation makes a random number of crossing overs to the genes of the parents and returns a list containing two new individuals. You may want to override this method to produce different mating schemes.
|