shark::EPTournamentSelection< Extractor > Struct Template Reference

Survival and mating selection to find the next parent set. More...

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

Public Member Functions

template<typename InIterator , typename OutIterator >
void operator() (DefaultRngType &rng, InIterator it, InIterator itE, OutIterator out, OutIterator outE)
 Selects individuals from the range of individuals. More...
 
template<typename Population >
void operator() (DefaultRngType &rng, Population &population, std::size_t mu)
 Selects individuals from the range of individuals. More...
 

Public Attributes

std::size_t tournamentSize
 Size of the tournament. 4 by default. More...
 

Detailed Description

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

Survival and mating selection to find the next parent set.

For a given Tournament size k, every individual is compared to k other individuals The fitness relation is governed by the double value returned by Extractor, which can be the fitness or a domination rank. The individuals which won the most torunaments are selected

Definition at line 45 of file EPTournamentSelection.h.

Member Function Documentation

§ operator()() [1/2]

template<typename Extractor >
template<typename InIterator , typename OutIterator >
void shark::EPTournamentSelection< Extractor >::operator() ( DefaultRngType rng,
InIterator  it,
InIterator  itE,
OutIterator  out,
OutIterator  outE 
)
inline

Selects individuals from the range of individuals.

Parameters
[in]itIterator pointing to the first valid parent individual.
[in]itEIterator pointing to the first invalid parent 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 54 of file EPTournamentSelection.h.

References shark::blas::distance(), and SHARKEXCEPTION.

§ operator()() [2/2]

template<typename Extractor >
template<typename Population >
void shark::EPTournamentSelection< Extractor >::operator() ( DefaultRngType rng,
Population population,
std::size_t  mu 
)
inline

Selects individuals from the range of individuals.

Instead of using an output range, surviving individuals are marked as selected.

Parameters
[in]populationThe population where individuals are selected from
[in]munumber of individuals to select

Definition at line 77 of file EPTournamentSelection.h.

References SIZE_CHECK.

Member Data Documentation

§ tournamentSize

template<typename Extractor >
std::size_t shark::EPTournamentSelection< Extractor >::tournamentSize

Size of the tournament. 4 by default.

Definition at line 95 of file EPTournamentSelection.h.


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