MTK++ Latest version: 0.2.0

Public Member Functions | Protected Member Functions | Protected Attributes
MTKpp::gaSelection Class Reference

Selects gaIndividuals from gaPopulation based on fitness. More...

#include <mtkpp/src/GA/gaSelection.h>

Collaboration diagram for MTKpp::gaSelection:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 gaSelection (gaOperators *parent=0, std::string selection="semi-random", int maxInds=0)
 gaSelection Constructor
virtual ~gaSelection ()
 gaSelection Destructor
int select ()
void setGaussian (int start, int end, double selPress)
 Create a gaGaussian.

Protected Member Functions

int __random ()
 Returns uniform random individuals.
int __semi_random ()
 Returns semi-random individuals weighted by a normal gaussian distribution.
int __rouletteWheel ()
 returns individuals using proportional fitness/roulette wheel
int __tournament ()
 returns individuals by perform a tournament (size N) of fitness
int __truncation ()
 Used by the keep operator a certain percentage of the generation is allowed to live without competition or selection.

Protected Attributes

gaOperatorspParent
 gaOperators pointer
gaGaussianpGaGaussian
 gaGaussian pointer
std::string selection
 Selection method used.
int maxInds
 Maximum number of gaIndividuals in the gaPopulation.

Detailed Description

Selects gaIndividuals from gaPopulation based on fitness.

Selection Functions Available:

1) Random

2) Semi-random

3) Proportional fitness / Roulette wheel

4) Tournament

5) Truncation

Author:
Martin Peters
Version:
0.1
Date:
2005

Constructor & Destructor Documentation

MTKpp::gaSelection::gaSelection ( gaOperators parent = 0,
std::string  selection = "semi-random",
int  maxInds = 0 
)

gaSelection Constructor

Parameters:
parentgaOperators pointer
selectionType of selection procedure employed
maxIndsMaximum gaIndividuals in the gaPopulation

References maxInds, pGaGaussian, pParent, and selection.

MTKpp::gaSelection::~gaSelection ( ) [virtual]

gaSelection Destructor


Member Function Documentation

int MTKpp::gaSelection::select ( )
void MTKpp::gaSelection::setGaussian ( int  start,
int  end,
double  selPress 
)

Create a gaGaussian.

Parameters:
startStart value for the gaussian
endEnd value for the gaussian
selPressThe standard deviation of the gaussian

References maxInds, pGaGaussian, and MTKpp::gaGaussian::setup().

Referenced by MTKpp::gaOperators::setup().

int MTKpp::gaSelection::__random ( ) [protected]

Returns uniform random individuals.

References maxInds, and MTKpp::ranNumBetweenZeroAndX().

Referenced by select().

int MTKpp::gaSelection::__semi_random ( ) [protected]

Returns semi-random individuals weighted by a normal gaussian distribution.

References pGaGaussian, MTKpp::gaGaussian::pick(), and MTKpp::ranNumBetweenZeroAndOne().

Referenced by select().

int MTKpp::gaSelection::__rouletteWheel ( ) [protected]

returns individuals using proportional fitness/roulette wheel

Todo:
implement

Referenced by select().

int MTKpp::gaSelection::__tournament ( ) [protected]

returns individuals by perform a tournament (size N) of fitness

Todo:
implement

Referenced by select().

int MTKpp::gaSelection::__truncation ( ) [protected]

Used by the keep operator a certain percentage of the generation is allowed to live without competition or selection.

Todo:
implement

Referenced by select().


Member Data Documentation

gaOperators pointer

Referenced by gaSelection().

gaGaussian pointer

Referenced by __semi_random(), gaSelection(), and setGaussian().

std::string MTKpp::gaSelection::selection [protected]

Selection method used.

Referenced by gaSelection().

int MTKpp::gaSelection::maxInds [protected]

Maximum number of gaIndividuals in the gaPopulation.

Referenced by __random(), gaSelection(), and setGaussian().


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

Generated on Fri Dec 23 2011 09:28:55 for MTK++ by Doxygen 1.7.5.1