![]() |
Ultra 0.9.4
|
#include <evolution_replacement.h>
Public Member Functions | |
| template<PopulationWithMutex P> | |
| void | operator() (alps_layer_pair< P >, const scored_t &, status_t &) const |
| template<PopulationWithMutex P> | |
| void | try_promote_individuals (const P &, P &) const |
| template<PopulationWithMutex P> | |
| std::array< typename alps< E >::scored_t, 2 > | operator() (alps_layer_pair< const P > pops) const |
| Public Member Functions inherited from ultra::replacement::strategy< E > | |
| strategy (E &, const parameters &) | |
Additional Inherited Members | |
| Public Types inherited from ultra::replacement::strategy< E > | |
| using | individual_t = evaluator_individual_t<E> |
| using | fitness_t = evaluator_fitness_t<E> |
| using | scored_t = scored_individual<individual_t, fitness_t> |
| using | status_t = evolution_status<individual_t, fitness_t> |
| Protected Attributes inherited from ultra::replacement::strategy< E > | |
| E & | eva_ |
| const parameters & | params_ |
ALPS based replacement scheme.
This strategy select an individual for replacement by an ad hoc kill tournament. When an individual is too old for its current layer, it cannot be used to generate new individuals for that layer and eventually is removed from the layer. Optionally, an attempt can be made to move this individual up to the next layer – in which case it replaces some individual there that it's better than.
| std::array< typename alps< E >::scored_t, 2 > ultra::replacement::alps< E >::operator() | ( | alps_layer_pair< const P > | pops | ) | const |
Selects two parents using ALPS tournament selection.
| [in] | pops | pair of eligible layers. pops.primary() is the current/main layer; pops.secondary() (if present) is the immediately younger layer |
Used parameters:
The first two candidates are always sampled from the primary layer. The remaining evolution.tournament_size - 1 candidates use alps.p_main_layer.
Correctness assumes that:
| void ultra::replacement::alps< E >::operator() | ( | alps_layer_pair< P > | pops, |
| const scored_t & | offspring, | ||
| status_t & | status ) const |
| [in] | pops | a collection of references to populations. Can contain one or two elements. The first one (pop[0]) is the main/current layer; the second one, if available, is the next layer |
| [in] | offspring | the "incoming" scored individual |
| [out] | status | current evolution status |
Used parameters:
| void ultra::replacement::alps< E >::try_promote_individuals | ( | const P & | from, |
| P & | to ) const |
| [in] | from | starting layer |
| [out] | to | destination layer |
Try to promote individuals from layer from to to (with ALPS this is always the upper layer).