Roulette wheel selection operator. More...

Inheritance diagram for RouletteWheelSelection:

Public Member Functions

 RouletteWheelSelection ()
 Constructor.
 
virtual ~RouletteWheelSelection ()
 Destructor.
 
virtual void configure (ConfigurationParameters &params, 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 &params, QString prefix)
 Saves the actual status of parameters into the ConfigurationParameters object passed.
 
virtual const Genotypeselect ()
 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.
 
- Public Member Functions inherited from Selection
 Selection ()
 Constructor.
 
virtual ~Selection ()
 Destructor.
 
GeneticAlgoGA ()
 Return the GeneticAlgo used.
 
const Genomegenome () const
 Return the Genome on which it selects.
 
void setGA (GeneticAlgo *g)
 Set the GeneticAlgo used.
 
- Public Member Functions inherited from ParameterSettableWithConfigureFunction
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
 ParameterSettable ()
 
virtual void postConfigureInitialization ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
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.
 
- Protected Attributes inherited from Selection
GeneticAlgoga
 GeneticAlgo used.
 
const Genomegenomev
 Genome on which it selects Genotypes.
 

Additional Inherited Members

- Public Types inherited from ParameterSettableWithConfigureFunction
enum  Property
 
- Public Attributes inherited from ParameterSettableWithConfigureFunction
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettableWithConfigureFunction
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- Protected Member Functions inherited from ParameterSettableWithConfigureFunction
void notifyChangesToParam (QString paramName)
 
- Static Protected Member Functions inherited from ParameterSettableWithConfigureFunction
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.

~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
paramsthe object with configuration parameters
prefixthe 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
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
paramsthe configuration parameters object on which save actual parameters
prefixthe 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.

const Genotype * select ( )
virtual
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(), 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

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: