genetiK::TournamentSelection Class Reference
[Common GenetiK framework]

selects an Individual from a Population using Tournament policy More...

#include <TournamentSelection.h>

Inheritance diagram for genetiK::TournamentSelection:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TournamentSelection (unsigned int size)
 sets size as the Tournament size
virtual ~TournamentSelection (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 Tournament policy

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

Tournament selection chooses size individuals from the population, with uniform probability, and then selects the best among them.

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


Constructor & Destructor Documentation

genetiK::TournamentSelection::TournamentSelection unsigned int  size  ) 
 

sets size as the Tournament size

Parameters:
size desired Tournament size


Member Function Documentation

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

retrieves the Individual having highest fitness in the Population

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

Implements genetiK::SelectionMethod.

void genetiK::TournamentSelection::init Population population  )  [inline, virtual]
 

initializes the RouletteWheel selection method with a specific Population

Parameters:
population the Population to select the Individuals from

Reimplemented from genetiK::SelectionMethod.

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

selects an Individual from the current Population

Chooses size individuals from the Populations and selects the best among them.

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:15 2006 for GenetiK by  doxygen 1.4.6