![]() |
Ultra 0.9.4
|
#include <layered_population.h>
Classes | |
| struct | coord |
| class | base_iterator |
Public Types | |
| using | layer_t = linear_population<I> |
| using | layer_iter = typename std::list<layer_t>::iterator |
| using | layer_const_iter = typename std::list<layer_t>::const_iterator |
| using | value_type = I |
| using | const_iterator = base_iterator<true> |
| using | iterator = base_iterator<false> |
Public Member Functions | |
| layered_population (const ultra::problem &, bool=true) | |
| const layer_t & | front () const |
| layer_t & | front () |
| const layer_t & | back () const |
| layer_t & | back () |
| std::size_t | layers () const noexcept |
| const layer_t & | layer (std::size_t) const |
| layer_t & | layer (std::size_t) |
| auto | range_of_layers () const |
| auto | range_of_layers () |
| const I & | operator[] (coord) const |
| I & | operator[] (coord) |
| void | init (layer_t &) |
| void | add_layer () |
| bool | erase (layer_t &) |
| layer_iter | erase (layer_iter) |
| std::size_t | size () const |
| void | inc_age () |
| const ultra::problem & | problem () const |
| const_iterator | begin () const |
| const_iterator | end () const |
| iterator | begin () |
| iterator | end () |
| bool | is_valid () const |
| bool | load (std::istream &) |
| bool | save (std::ostream &) const |
A group of individuals which may interact together (for example by mating) producing offspring.
Typical population size ranges from one hundred to many thousands. The population is organized in one or more layers that can interact in many ways (depending on the evolution strategy).
|
explicit |
Creates a random population.
| [in] | p | current problem |
| [in] | init_subgroups | builds p.params.population.init_subgroups layers |
| void ultra::layered_population< I >::add_layer | ( | ) |
Adds a new layer to the population.
The new layer is inserted as the lower layer and randomly initialized.
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| layered_population< I >::layer_iter ultra::layered_population< I >::erase | ( | layer_iter | pos | ) |
Erases the specified element from the container.
| [in] | pos | iterator to the element to remove |
References and iterators to the erased element are invalidated. Other references and iterators are not affected.
| bool ultra::layered_population< I >::erase | ( | layer_t & | l | ) |
Erases the specified element from the container.
| [in] | l | reference to the element to remove |
|
nodiscard |
|
nodiscard |
| void ultra::layered_population< I >::inc_age | ( | ) |
Increments the age of each individual of the population
| void ultra::layered_population< I >::init | ( | layer_t & | l | ) |
Resets a layer of the population.
| [in] | l | a layer of the population |
|
nodiscard |
|
nodiscard |
| [in] | l | layer index |
|
nodiscard |
| [in] | l | layer index |
|
nodiscardnoexcept |
|
nodiscard |
| [in] | in | input stream |
|
nodiscard |
| [in] | c | coordinate identifying an individual within the population |
|
nodiscard |
| [in] | c | coordinate identifying an individual within the population |
|
nodiscard |
|
nodiscard |
| [out] | out | output stream |
|
nodiscard |