genetiK::RouletteWheel Class Reference
[Common GenetiK framework]

selects an Individual from a Population using Roulette Wheel policy More...

#include <RouletteWheel.h>

Inheritance diagram for genetiK::RouletteWheel:

Inheritance graph
[legend]
Collaboration diagram for genetiK::RouletteWheel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RouletteWheel (void)
 default constructor
virtual ~RouletteWheel (void)
 default destructor
void init (Population *population)
 initializes the RouletteWheel selection method with a specific Population
Individualselect ()
 selects an Individual from the current Population
IndividualgetBest ()
 retrieves the Individual having highest fitness in the Population

Detailed Description

selects an Individual from a Population using Roulette Wheel policy

This class encapsulates the "Roulette Wheel" policy to select individuals from a population.

Roulette Wheel selection is defined as follows: each Individual i in the Population can be selected with probability

\[ P_i = \frac{f_i}{\sum\limits_{j=0}^{N-1}f_j} \]

where $f_j$ is the fitness of i

See also:
Individual::fitness(), SelectionMethod, RankingSelection and TournamentSelection


Member Function Documentation

Individual * genetiK::RouletteWheel::getBest  )  [virtual]
 

retrieves the Individual having highest fitness in the Population

Returns:
the best Individual
See also:
Individual::fitness()

Implements genetiK::SelectionMethod.

void genetiK::RouletteWheel::init Population population  )  [virtual]
 

initializes the RouletteWheel selection method with a specific Population

When initializing, the Cumulative Distribution Function (CDF) associated to the probability distribution defined by the previously mentioned $P_i$ is calculated.

Parameters:
population the Population to select the Individuals from

Reimplemented from genetiK::SelectionMethod.

Individual * genetiK::RouletteWheel::select  )  [virtual]
 

selects an Individual from the current Population

An Individual i will be selected with probability

\[ P_i = \frac{f_i}{\sum\limits_{j=0}^{N-1}f_j} \]

Returns:
the selected Individual
Exceptions:
IllegalStateException if the Population has not been previously initialized with init(Population* population)
See also:
init(Population* population), IllegalStateException

Implements genetiK::SelectionMethod.


The documentation for this class was generated from the following files:
Generated on Thu Feb 23 12:22:05 2006 for GenetiK by  doxygen 1.4.6