Population::SelectionOperations::GaSelectRouletteWheel Class Reference

When GaSelectRouletteWheel selection is used chromosomes with better fitness values have better chances to be selected. It virtually transforms fitness value of chromosome to probability of selection. Population on which selection performed must be sorted. This selection can work with minimization or maximization of fitness values, as well as negative fitness values. This selection use GaSelectDuplicatesParams class for parameters. More...

#include <D:/Temp/vs/gal/source/SelectionOperations.h>

Inherits Population::GaSelectionOperation.

Inherited by Population::SelectionOperations::GaSelectTournament.

List of all members.

Public Member Functions

virtual GAL_API void GACALL operator() (const GaPopulation &population, const GaSelectionParams &parameters, GaSelectionResultSet &result) const
 More details are given in specification of GaSelectionOperation::operator () method.
virtual GaParameters *GACALL MakeParameters () const
 More details are given in specification of GaOperation::MakeParameters method.
virtual bool GACALL CheckParameters (const GaParameters &parameters) const
 Valid parameters must have selection size grater then 0.

Protected Member Functions

virtual GAL_API int GACALL Select (const GaSelectionResultSet &result, const GaPopulation &population, const GaSelectionParams &parameters) const
 Select method selects only one chromosome using roulette wheel selection algorithm.


Detailed Description

When GaSelectRouletteWheel selection is used chromosomes with better fitness values have better chances to be selected. It virtually transforms fitness value of chromosome to probability of selection. Population on which selection performed must be sorted. This selection can work with minimization or maximization of fitness values, as well as negative fitness values. This selection use GaSelectDuplicatesParams class for parameters.

This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. Because this genetic operation is stateless all public method are thread-safe.


Member Function Documentation

void Population::SelectionOperations::GaSelectRouletteWheel::operator() ( const GaPopulation population,
const GaSelectionParams parameters,
GaSelectionResultSet result 
) const [virtual]

More details are given in specification of GaSelectionOperation::operator () method.

This method is thread-safe.

Implements Population::GaSelectionOperation.

Reimplemented in Population::SelectionOperations::GaSelectTournament.

virtual GaParameters* GACALL Population::SelectionOperations::GaSelectRouletteWheel::MakeParameters (  )  const [inline, virtual]

More details are given in specification of GaOperation::MakeParameters method.

This method is thread-safe.

Returns:
Method returns new instance of GaSelectDuplicatesParams class.

Implements Common::GaOperation.

Reimplemented in Population::SelectionOperations::GaSelectTournament.

virtual bool GACALL Population::SelectionOperations::GaSelectRouletteWheel::CheckParameters ( const GaParameters parameters  )  const [inline, virtual]

Valid parameters must have selection size grater then 0.

More details are given in specification of GaOperation::CheckParameters method.

This method is thread-safe.

Implements Common::GaOperation.

Reimplemented in Population::SelectionOperations::GaSelectTournament.

int Population::SelectionOperations::GaSelectRouletteWheel::Select ( const GaSelectionResultSet result,
const GaPopulation population,
const GaSelectionParams parameters 
) const [protected, virtual]

Select method selects only one chromosome using roulette wheel selection algorithm.

This method is not thread-safe.

Parameters:
result reference to selection result set which is used to store selected chromosome.
population reference to population on which selection is performed.
parameters reference to parameters of population.
Returns:
Method returns index of selected chromosome.


The documentation for this class was generated from the following files:

Genetic Algorithm Library
Coolsoft Software Development