RouletteWheelSelection Class Reference
Roulette wheel selection operator. More...

Public Member Functions | |
RouletteWheelSelection () | |
Constructor. | |
virtual | ~RouletteWheelSelection () |
Destructor. | |
virtual void | configure (ConfigurationParameters ¶ms, QString prefix) |
Configures the object using the ConfigurationParameters specified. | |
int | notSelectedForBreeding () |
Returns the number of individuals which are discarded among those with the lowest fitness. | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Saves the actual status of parameters into the ConfigurationParameters object passed. | |
virtual const Genotype * | select () |
Select a Genotype. | |
virtual void | setGenome (const Genome *g) |
Initializes RouletteWheelSelection. | |
void | setNotSelectedForBreeding (int notSelectedForBreeding) |
Sets the number of individuals which are discarded among those with the lowest fitness. | |
Static Public Member Functions | |
static void | describe (QString type) |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups. | |
Protected Attributes | |
QVector< double > | m_cumulativeFitness |
The vector with cumulative fitness for individuals. | |
int | m_notSelectedForBreeding |
The number of individuals not selected for reproduction among those with the lowest fitness. |
Detailed Description
Roulette wheel selection operator.
- Description
- This class implements the roulette wheel selection scheme: each indivual has a probability of being selected for reproduction which is proportional to its fitness. It is possible to exclude from selection the individuals with the lowest fitness (the exact number is configurable)
- Warnings
Definition at line 40 of file roulettewheelselection.h.
Constructor & Destructor Documentation
Constructor.
Definition at line 28 of file roulettewheelselection.cpp.
~RouletteWheelSelection | ( | ) | [virtual] |
Destructor.
Definition at line 35 of file roulettewheelselection.cpp.
Member Function Documentation
void configure | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [virtual] |
Configures the object using the ConfigurationParameters specified.
- Parameters:
-
params the object with configuration parameters prefix the group in which parameters are expected to be (this is terminated by a separator character). We expect to receive as prefix the group with selection parameters
Implements ParameterSettableWithConfigureFunction.
Definition at line 73 of file roulettewheelselection.cpp.
References ConfigurationParameters::getValue(), and RouletteWheelSelection::m_notSelectedForBreeding.
void describe | ( | QString | type | ) | [static] |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
Reimplemented from ParameterSettable.
Definition at line 84 of file roulettewheelselection.cpp.
References ParameterSettable::addTypeDescription(), ParameterSettable::Descriptor::describeInt(), ParameterSettable::IntDescriptor::help(), and ParameterSettable::IntDescriptor::limits().
int notSelectedForBreeding | ( | ) |
Returns the number of individuals which are discarded among those with the lowest fitness.
Definition at line 68 of file roulettewheelselection.cpp.
References RouletteWheelSelection::m_notSelectedForBreeding.
Referenced by RouletteWheelSelection::setNotSelectedForBreeding().
void save | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [virtual] |
Saves the actual status of parameters into the ConfigurationParameters object passed.
- Parameters:
-
params the configuration parameters object on which save actual parameters prefix the prefix to use to access the object configuration parameters.
Implements ParameterSettable.
Definition at line 78 of file roulettewheelselection.cpp.
References ConfigurationParameters::createParameter(), and RouletteWheelSelection::m_notSelectedForBreeding.
const Genotype * select | ( | ) | [virtual] |
Select a Genotype.
Implements Selection.
Definition at line 40 of file roulettewheelselection.cpp.
References Genome::at(), Selection::genome(), RandomGenerator::getDouble(), globalRNG, and RouletteWheelSelection::m_cumulativeFitness.
void setGenome | ( | const Genome * | g | ) | [virtual] |
Initializes RouletteWheelSelection.
More in detail, computes the selection probabilities for each individual
Reimplemented from Selection.
Definition at line 52 of file roulettewheelselection.cpp.
References Genome::at(), RouletteWheelSelection::m_cumulativeFitness, RouletteWheelSelection::m_notSelectedForBreeding, Genotype::rank(), and Genome::size().
void setNotSelectedForBreeding | ( | int | notSelectedForBreeding | ) |
Sets the number of individuals which are discarded among those with the lowest fitness.
Definition at line 63 of file roulettewheelselection.cpp.
References RouletteWheelSelection::m_notSelectedForBreeding, and RouletteWheelSelection::notSelectedForBreeding().
Member Data Documentation
QVector<double> m_cumulativeFitness [protected] |
The vector with cumulative fitness for individuals.
Definition at line 94 of file roulettewheelselection.h.
Referenced by RouletteWheelSelection::select(), and RouletteWheelSelection::setGenome().
int m_notSelectedForBreeding [protected] |
The number of individuals not selected for reproduction among those with the lowest fitness.
Definition at line 89 of file roulettewheelselection.h.
Referenced by RouletteWheelSelection::configure(), RouletteWheelSelection::notSelectedForBreeding(), RouletteWheelSelection::save(), RouletteWheelSelection::setGenome(), and RouletteWheelSelection::setNotSelectedForBreeding().
The documentation for this class was generated from the following files:
- ga/include/selections/roulettewheelselection.h
- ga/src/selections/roulettewheelselection.cpp