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

Public Methods | |
| RankSelector (double selectionProbability=0.25, double rate=0.2) | |
| Create a new RankSelector with the given survivor selection probability and survival rate. | |
| virtual void | selectSurvivors (const util::List< Individual< T > > &from, util::List< Individual< T > > &to) |
| Select some fit individuals that survive to the next generation. | |
Public Attributes | |
| double | survivorSelectionProbability |
| A value in the range [0,1] that tells how probable it is for the fittest individual to be first selected as a survivor. | |
| double | survivalRate |
| A value in the range [0,1] that indicates the fraction of a population that survives to the next generation. | |
|
||||||||||||||||
|
Create a new RankSelector with the given survivor selection probability and survival rate. If you are using a CrossingOverBreeder 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 some fit individuals that survive to the next generation. This implementation selects survivalRate*from.getLength() individuals from from using a rank selection method. That is, the most fit individual is selected to the next generation with the probability selectionProbability in the first round. If it is not selected, the second most fit individual is selected with the same probability. This continues until an individual is selected. The same procedure is repeated for the remaining individuals until the needed number of individuals is selected.
Implements prapi::ga::SurvivorSelector< T >. |