pagmo::
sea
¶(N+1)-ES Simple Evolutionary Algorithm
Evolutionary strategies date back to the mid 1960s when P. Bienert, I. Rechenberg, and H.-P. Schwefel at the Technical University of Berlin, Germany, developed the first bionics-inspired schemes for evolving optimal shapes of minimal drag bodies in a wind tunnel using Darwin’s evolution principle.
This c++ class represents the simplest evolutionary strategy, where a population of \( \lambda \) individuals at each generation produces one offspring by mutating its best individual uniformly at random within the bounds. Should the offspring be better than the worst individual in the population it will substitute it.
Public Types
log_line_type
¶Single entry of the log (gen, fevals, best, improvement, mutations)
log_type
¶The log.
Public Functions
sea
(unsigned int gen = 1u, unsigned int seed = pagmo::random_device::next ())¶Constructor.
Constructs a sea algorithm from the number of generations and the random seed.
gen
- Number of generations to consider. Each generation will compute the objective function once
seed
- seed used by the internal random number generator
evolve
(population pop) const¶Algorithm evolve method (juice implementation of the algorithm)
pop
- population to be evolved
std::invalid_argument
- if the problem is multi-objective or constrained
set_seed
(unsigned int seed)¶Sets the algorithm seed.
set_verbosity
(unsigned int level)¶Sets the algorithm verbosity.
Sets the verbosity level of the screen output and of the log returned by get_log(). level
can be:
level
generations.Example (verbosity 1): Gen, is the generation number, Fevals the number of function evaluation used, Best is the best fitness function currently in the population, Improvement is the improvement made by the las mutation and Mutations is the number of mutated componnets of the decision vector
Gen: Fevals: Best: Improvement: Mutations:
632 3797 1464.31 51.0203 1
633 3803 1463.23 13.4503 1
635 3815 1562.02 31.0434 3
667 4007 1481.6 24.1889 1
668 4013 1487.34 73.2677 2
level
- verbosity level
get_seed
() const¶Gets the seed.
get_verbosity
() const¶Gets the verbosity level.
get_name
() const¶Algorithm name.
get_extra_info
() const¶Extra informations.
get_log
() const¶Get log.
A log containing relevant quantities monitoring the last call to evolve. Each element of the returned std::vector
is a sea::log_line_type containing: Gen, Fevals, Best, Improvement, Mutations as described in sea::set_verbosity
std::vector
of sea::log_line_type containing the logged values Gen, Fevals, Best, Improvement, Mutations serialize
(Archive &ar)¶Serialization.