genetiK::SelectionMethod Class Reference
[Common GenetiK framework]

selects an Individual from a Population More...

#include <SelectionMethod.h>

Inheritance diagram for genetiK::SelectionMethod:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Detailed Description

selects an Individual from a Population

This abstract class encapsulates a policy to select individuals from a population. It should be extended to implement specific selection methods.

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


Member Function Documentation

virtual Individual* genetiK::SelectionMethod::getBest  )  [pure virtual]
 

retrieves the Individual having highest fitness in the Population

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

Implemented in genetiK::RankingSelection, genetiK::RouletteWheel, and genetiK::TournamentSelection.

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

initializes the SelectionMethod with a specific Population

Parameters:
population the Population to select the Individuals from

Reimplemented in genetiK::RankingSelection, genetiK::RouletteWheel, and genetiK::TournamentSelection.

virtual Individual* genetiK::SelectionMethod::select  )  [pure virtual]
 

selects an Individual from the current Population

Subclasses override this method to implement a specific selection policy

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

Implemented in genetiK::RankingSelection, genetiK::RouletteWheel, and genetiK::TournamentSelection.


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