|
| | Population ()=delete |
| |
| | Population (const std::size_t size) |
| | Initialises a new instance of the Population class.
|
| |
| std::size_t | size () const noexcept |
| | Gets the current size of the population.
|
| |
| std::size_t | initial_size () const noexcept |
| | Gets the initial size of the population.
|
| |
| std::size_t | current_active_size () const noexcept |
| | Gets the current active size of the population.
|
| |
| Person & | operator[] (std::size_t index) |
| | Gets a Person by index without bounds checking.
|
| |
| const Person & | operator[] (std::size_t index) const |
| | Gets a Person by index without bounds checking.
|
| |
| Person & | at (std::size_t index) |
| | Gets a Person by index with bounds checking.
|
| |
| const Person & | at (std::size_t index) const |
| | Gets a Person by index with bounds checking.
|
| |
| void | add (Person person, unsigned int time) noexcept |
| | Adds a Person to the virtual population.
|
| |
| void | add_newborn_babies (std::size_t number, core::Gender gender, unsigned int time) noexcept |
| | Adds newborn babies of gender to the virtual population, age = 0.
|
| |
| IteratorType | begin () noexcept |
| | Gets an iterator to the beginning of the virtual population.
|
| |
| IteratorType | end () noexcept |
| | Gets an iterator to the element following the last Person of the population.
|
| |
| ConstIteratorType | begin () const noexcept |
| | Gets an read-only iterator to the beginning of the virtual population.
|
| |
| ConstIteratorType | end () const noexcept |
| | Gets a read-only iterator to the element following the last Person of the population.
|
| |
| ConstIteratorType | cbegin () const noexcept |
| | Gets an read-only iterator to the beginning of the virtual population.
|
| |
| ConstIteratorType | cend () const noexcept |
| | Gets a read-only iterator to the element following the last Person of the population.
|
| |
Defines the virtual population data type.
The virtual population size is dynamic and can change due to births, deaths and emigration. When possible, the Population class recycles the dead and migrated individuals slots with newborn babies to minimise memory allocation and clear-up the inactive population. Person IDs are lifetime-unique within a run: slots may be reused, IDs are not.