shark::LinearRankingSelection< Extractor > Struct Template Reference

Implements a fitness-proportional selection scheme for mating selection that scales the fitness values linearly before carrying out the actual selection. More...

#include <shark/Algorithms/DirectSearch/Operators/Selection/LinearRanking.h>

Public Member Functions

 LinearRankingSelection ()
 
template<typename InIterator , typename OutIterator >
void operator() (DefaultRngType &rng, InIterator individuals, InIterator individualsE, OutIterator out, OutIterator outE) const
 Selects individualss from the range of parent and offspring individuals. More...
 

Public Attributes

double etaMax
 Selective pressure, parameter in [1,2] conrolling selection strength. 1.1 by default. More...
 

Detailed Description

template<typename Extractor>
struct shark::LinearRankingSelection< Extractor >

Implements a fitness-proportional selection scheme for mating selection that scales the fitness values linearly before carrying out the actual selection.

The algorithm is described in: James E. Baker. Adaptive Selection Methods for Genetic Algorithms. In John J. Grefenstette (ed.): Proceedings of the 1st International Conference on Genetic Algorithms (ICGA), pp. 101-111, Lawrence Erlbaum Associates, 1985

Definition at line 57 of file LinearRanking.h.

Constructor & Destructor Documentation

§ LinearRankingSelection()

template<typename Extractor >
shark::LinearRankingSelection< Extractor >::LinearRankingSelection ( )
inline

Member Function Documentation

§ operator()()

template<typename Extractor >
template<typename InIterator , typename OutIterator >
void shark::LinearRankingSelection< Extractor >::operator() ( DefaultRngType rng,
InIterator  individuals,
InIterator  individualsE,
OutIterator  out,
OutIterator  outE 
) const
inline

Selects individualss from the range of parent and offspring individuals.

The operator carries out the following steps:

  • Calculate selection probabilities of parent and offspring individualss according to their rank.
  • Carry out roulette wheel selection on the range of parent and offspring individualss until the output range is filled.
Parameters
[in]individualsIterator pointing to the first valid individual.
[in]individualsEIterator pointing to the first invalid individual.
[in]outIterator pointing to the first valid element of the output range.
[in]outEIterator pointing to the first invalid element of the output range.

Definition at line 75 of file LinearRanking.h.

References shark::blas::distance(), shark::LinearRankingSelection< Extractor >::etaMax, shark::size(), and shark::blas::sum().

Member Data Documentation

§ etaMax

template<typename Extractor >
double shark::LinearRankingSelection< Extractor >::etaMax

Selective pressure, parameter in [1,2] conrolling selection strength. 1.1 by default.

Definition at line 109 of file LinearRanking.h.

Referenced by shark::LinearRankingSelection< Extractor >::LinearRankingSelection(), and shark::LinearRankingSelection< Extractor >::operator()().


The documentation for this struct was generated from the following file: