Vita
alps.h
Go to the documentation of this file.
1
13#if !defined(VITA_ALPS_H)
14#define VITA_ALPS_H
15
16namespace vita::alps
17{
18
27{
28 [[nodiscard]] unsigned allowed_age(unsigned, unsigned) const;
29 [[nodiscard]] unsigned max_age(unsigned) const;
30
31 template<class T> [[nodiscard]] bool aged(const T &,
32 unsigned, unsigned) const;
33
48 unsigned age_gap = 20;
49
55 double p_same_layer = 0.75;
56};
57
64template<class T> bool parameters::aged(const T &p,
65 unsigned l, unsigned layers) const
66{
67 return p.age() > allowed_age(l, layers);
68}
69
70} // namespace vita::alps
71
72#endif // include guard
Parameters for the Age-Layered Population Structure (ALPS) paradigm.
Definition: alps.h:27
double p_same_layer
We already have a parent (individual) from a layer, which is the probability that the second parent w...
Definition: alps.h:55
bool aged(const T &, unsigned, unsigned) const
Definition: alps.h:64
unsigned max_age(unsigned) const
Definition: alps.cc:39
unsigned age_gap
The maximum ages for age layers is monotonically increasing and different methods can be used for set...
Definition: alps.h:48
unsigned allowed_age(unsigned, unsigned) const
Definition: alps.cc:27