Vita
evolution_replacement.h
Go to the documentation of this file.
1
13#if !defined(VITA_EVOLUTION_REPLACEMENT_H)
14#define VITA_EVOLUTION_REPLACEMENT_H
15
16#include "kernel/alps.h"
17
18namespace vita::replacement
19{
32template<class T>
34{
35public:
36 using offspring_t = typename recombination::strategy<T>::offspring_t;
37 using parents_t = typename selection::strategy<T>::parents_t;
38
40
41protected:
42 population<T> &pop_;
43 evaluator<T> &eva_;
44};
45
64template<class T>
66{
67public:
68 using family_competition::strategy::strategy;
69
70 void run(const typename strategy<T>::parents_t &,
71 const typename strategy<T>::offspring_t &, summary<T> *);
72};
73
86template<class T>
87class tournament : public strategy<T>
88{
89public:
90 using tournament::strategy::strategy;
91
92 void run(const typename strategy<T>::parents_t &,
93 const typename strategy<T>::offspring_t &, summary<T> *);
94};
95
113template<class T>
114class alps : public strategy<T>
115{
116public:
117 using alps::strategy::strategy;
118
119 void run(const typename strategy<T>::parents_t &,
120 const typename strategy<T>::offspring_t &, summary<T> *);
121
122 void try_move_up_layer(unsigned);
123
124private:
125 [[nodiscard]] unsigned allowed_age(unsigned) const;
126 bool try_add_to_layer(unsigned, const T &);
127};
128
129template<class T>
130class pareto : public strategy<T>
131{
132public:
133 using pareto::strategy::strategy;
134
135 void run(const typename strategy<T>::parents_t &,
136 const typename strategy<T>::offspring_t &, summary<T> *);
137};
138
139#include "kernel/evolution_replacement.tcc"
140
141} // namespace vita::replacement
142
143#endif // include guard
Calculates the fitness of an individual.
Definition: evaluator.h:54
A group of individuals which may interact together (for example by mating) producing offspring.
Definition: population.h:37
A family competition replacement scheme.
The replacement strategy (random, tournament...) for the vita::evolution_strategy class.
Tournament based replacement scheme (aka kill tournament).
A summary of evolution (results, statistics...).
Contains support functions for the ALPS algorithm.