Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Selector Class Reference

Selection handler of an Individual. More...

#include <selection.h>

Inheritance diagram for Selector:

SelectionPrms List of all members.

Public Methods

void read (const Genome &g)
double select (const SelectionSituation &situation, int self_i, int other_j) const
int score () const
void virginize ()

Static Public Methods

void addGenesTo (Gentainer &g, const StringMap &params)

Protected Methods

virtual double selectWithMethod (const SelectionSituation &situation, int smno, int i, int j) const
double muLambdaSelection (const SelectionSituation &situation, int i, int j) const
double linearRanking (const SelectionSituation &situation, int i, int j) const
double proportionalSelection (const SelectionSituation &situation, int i, int j) const
double tournamentSelection (const SelectionSituation &situation, int i, int j) const

Protected Attributes

int mScore

Detailed Description

Selection handler of an Individual.

Each individual has one instance of this class to handle all it's selection tasks.

This class provides some additional functionality for SelectionPrms. It is kept separate because we don't want to give these methods if not necessary.

Definition at line 239 of file selection.h.


Member Function Documentation

void addGenesTo Gentainer   g,
const StringMap &    params
[static]
 

Inserts genes that control selection into the given genome, if the selection parameters are set to be self-adaptive.

Parameters:
params  Dynamic parameters in a String Map. See various methods of SelectionPrms and SelectionMatrix for further descriptions of the parameters.
params  ["mu"] mu-parameter for (mu,+lambda)-Selection.
params  ["q"] q-parameter for tournament selection.
params  ["eta+"] eta+-parameter for proportional selection.
params  ["adaptMu"] Should mu be self-adapted? [Default:0]
params  ["adaptQ"] Should q be self-adapted? [Default:0]
params  ["adaptEta+"] Should eta+ be self-adapted? [Default:0]

Definition at line 212 of file selection.cc.

References Gentainer::add(), and Genstruct::hide().

Referenced by Individual::addGenesTo().

double linearRanking const SelectionSituation   situation,
int    i,
int    j
const [protected]
 

Selection method where the individuals are ranked according to their fitness, and the selection probability is a linear function of this rank.

Definition at line 304 of file selection.cc.

References SelectionPrms::mEtaPlus, SimplePopulation::mUseGlobalEtaPlus, SelectionSituation::population(), SimplePopulation::selParams(), and SimplePopulation::size().

Referenced by selectWithMethod().

double muLambdaSelection const SelectionSituation   situation,
int    i,
int    j
const [protected]
 

Evolution Strategies (mu,+lambda)-Selection, where lambda is the number fittest individuals in the population that can be potential parents, and lambda is the number of offspring.

Definition at line 293 of file selection.cc.

References SelectionPrms::muFor(), SimplePopulation::mUseGlobalMu, SelectionSituation::population(), SimplePopulation::selParams(), and SimplePopulation::size().

Referenced by selectWithMethod().

double proportionalSelection const SelectionSituation   situation,
int    i,
int    j
const [protected]
 

Proportional selection.

Definition at line 312 of file selection.cc.

References FitnessStats::avgFitness(), Individual::getfitness(), SelectionSituation::getOrdered(), SimplePopulation::mFitnessStats, and SelectionSituation::population().

Referenced by selectWithMethod().

void read const Genome   g
 

Reads selection parameters from the given genome.

Definition at line 233 of file selection.cc.

References Gentainer::getGene(), SelectionPrms::mEtaPlus, SelectionPrms::mMuPart, SelectionPrms::mQ, and SelectionPrms::mSelMethodW.

Referenced by Individual::incarnate().

int score   const [inline]
 

Tells how many times the individual has got some.

(Hmm, shouldn't this kind of information be private??).

Definition at line 274 of file selection.h.

References mScore.

double select const SelectionSituation   situation,
int    self_i,
int    other_j
const
 

Returns the selection affinity of individual i to individual j, combined over all different selection methods.

Definition at line 258 of file selection.cc.

References SelectionPrms::mSelMethodW, and selectWithMethod().

Referenced by SelectionMatrix::calculateMatrix().

double selectWithMethod const SelectionSituation   situation,
int    smno,
int    i,
int    j
const [protected, virtual]
 

Returns the selection probability for individuals i and j.

Parameters:
smno  Selection method number (see the enum 'smconsts').
i  The individual making the selection choise.
j  The target of selection.
Returns:
Selection probability (not affinity) of Individual j by i.

Definition at line 279 of file selection.cc.

References linearRanking(), muLambdaSelection(), proportionalSelection(), and tournamentSelection().

Referenced by select().

double tournamentSelection const SelectionSituation   situation,
int    i,
int    j
const [protected]
 

Tournament selection.

Definition at line 316 of file selection.cc.

References SelectionPrms::mQ, SimplePopulation::mUseGlobalQ, SelectionSituation::population(), SimplePopulation::selParams(), and SimplePopulation::size().

Referenced by selectWithMethod().

void virginize   [inline]
 

Makes the individual virgin again (resets it's score).

Wow. *

Definition at line 277 of file selection.h.

References mScore.


Member Data Documentation

int mScore [protected]
 

Some selection methods, like the method the canonic GA, select some of the best individuals with 100% propability.

To achieve this, we have to count how many times an individual has got some.

Definition at line 319 of file selection.h.

Referenced by score(), and virginize().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:12:01 2005 for NeHeP by doxygen1.2.18