Vita
|
Defines the skeleton of the evolution, deferring some steps to client subclasses. More...
#include <evolution_strategy.h>
Public Member Functions | |
void | after_generation () const |
Work to be done at the end of a generation. More... | |
evolution_strategy (population< T > &pop, evaluator< T > &eva, summary< T > *s) | |
void | init () const |
Initial setup performed before evolution starts. More... | |
void | log_strategy (unsigned, unsigned) const |
Evolution strategy specific log function (it's called by the evolution::log method). More... | |
bool | stop_condition () const |
Used to signal strategy specific stop conditions. More... | |
Static Public Member Functions | |
static environment | shape (const environment &env) |
Sets strategy-specific parameters. More... | |
Public Attributes | |
CS< T > | recombination |
RS< T > | replacement |
SS< T > | selection |
Static Public Attributes | |
static constexpr bool | is_alps |
static constexpr bool | is_de |
Protected Attributes | |
population< T > & | pop_ |
summary< T > * | sum_ |
Defines the skeleton of the evolution, deferring some steps to client subclasses.
T | type of individual |
SS | class containing the selection strategy |
CS | class containing the recombination strategy |
RS | class containing the replacement strategy |
Selection, recombination and replacement are the main steps of evolution. In the literature a lot of different algorithms are described and many of them are implemented in Vita (not every combination is meaningful).
The user can choose, at compile time, how the evolution class should work via the evolution strategy class (or one of its specialization).
In other words the template method design pattern is used to "inject" selection, recombination and replacement methods specified by the evolution_strategy object into an evolution
object.
Definition at line 46 of file evolution_strategy.h.
|
inline |
Definition at line 49 of file evolution_strategy.h.
|
inline |
Work to be done at the end of a generation.
Definition at line 70 of file evolution_strategy.h.
|
inline |
Initial setup performed before evolution starts.
Definition at line 67 of file evolution_strategy.h.
|
inline |
Evolution strategy specific log function (it's called by the evolution::log
method).
Definition at line 58 of file evolution_strategy.h.
|
inlinestatic |
Sets strategy-specific parameters.
The default implementation doesn't change the user-specified environment. Some evolution strategies force parameters to specific values.
Definition at line 64 of file evolution_strategy.h.
|
inline |
Used to signal strategy specific stop conditions.
Definition at line 73 of file evolution_strategy.h.
|
staticconstexpr |
Definition at line 75 of file evolution_strategy.h.
|
staticconstexpr |
Definition at line 79 of file evolution_strategy.h.
|
protected |
Definition at line 88 of file evolution_strategy.h.
CS<T> vita::evolution_strategy< T, SS, CS, RS >::recombination |
Definition at line 84 of file evolution_strategy.h.
RS<T> vita::evolution_strategy< T, SS, CS, RS >::replacement |
Definition at line 85 of file evolution_strategy.h.
SS<T> vita::evolution_strategy< T, SS, CS, RS >::selection |
Definition at line 83 of file evolution_strategy.h.
|
protected |
Definition at line 89 of file evolution_strategy.h.