This class makes a select by randomized comparison of one individual of the old generation with a random number. More...
#include <RandomSelectStrategy.h>
Inherits ISelectStrategy.

Public Member Functions | |
| RandomSelectStrategy (RandGen *random) | |
| constructor | |
| virtual | ~RandomSelectStrategy () |
| default destructor | |
| virtual void | select (Generation *oldGeneration, Generation *newGeneration) |
| implementation for the interface ISelectStrategy | |
Protected Attributes | |
| RandGen * | m_random |
| the random generator | |
This class makes a select by randomized comparison of one individual of the old generation with a random number.
If it lost, so it dosn't comes in the next generation. If enough individual "killed", comes the living in the next generation.
With this method it is possible that a bad individual comes in the next generation. So you dosn't becomes a to elite generation and save some alternatives in the gens. This way is in this point better than the EliteSelectStrategy. But worse than the TournamentSelectStrategy.
| RandomSelectStrategy | ( | RandGen * | random | ) |
constructor
| random | (RandGen*) a random generator. Is needed for the <<<randomized>>> comparison |
| ~RandomSelectStrategy | ( | ) | [virtual] |
default destructor
| void select | ( | Generation * | oldGeneration, | |
| Generation * | newGeneration | |||
| ) | [virtual] |
implementation for the interface ISelectStrategy
| oldGeneration | (Generation*) the old generation | |
| newGeneration | (Generation*) the next generation |
Implements ISelectStrategy.
1.6.3