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. | |
![]() | |
Selection () | |
Constructor. | |
virtual | ~Selection () |
Destructor. | |
GeneticAlgo * | GA () |
Return the GeneticAlgo used. | |
const Genome * | genome () const |
Return the Genome on which it selects. | |
void | setGA (GeneticAlgo *g) |
Set the GeneticAlgo used. | |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
ParameterSettable () | |
virtual void | postConfigureInitialization () |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
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. | |
![]() | |
GeneticAlgo * | ga |
GeneticAlgo used. | |
const Genome * | genomev |
Genome on which it selects Genotypes. | |
Additional Inherited Members | |
![]() | |
enum | Property |
![]() | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
![]() | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
![]() | |
void | notifyChangesToParam (QString paramName) |
![]() | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
static void | setGraphicalEditor (QString type) |
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.
|
virtual |
Destructor.
Definition at line 35 of file roulettewheelselection.cpp.
Member Function Documentation
|
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.
|
static |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
Definition at line 84 of file roulettewheelselection.cpp.
References ParameterSettableWithConfigureFunction::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().
|
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 ParameterSettableWithConfigureFunction.
Definition at line 78 of file roulettewheelselection.cpp.
References ConfigurationParameters::createParameter(), and RouletteWheelSelection::m_notSelectedForBreeding.
|
virtual |
Select a Genotype.
Implements Selection.
Definition at line 40 of file roulettewheelselection.cpp.
References Genome::at(), Selection::genome(), globalRNG, and RouletteWheelSelection::m_cumulativeFitness.
|
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(), Selection::setGenome(), 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
|
protected |
The vector with cumulative fitness for individuals.
Definition at line 94 of file roulettewheelselection.h.
Referenced by RouletteWheelSelection::select(), and RouletteWheelSelection::setGenome().
|
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