28 std::size_t
size() const noexcept;
46 const
Person &operator[](
std::
size_t index) const;
63 void add(
Person &&person,
unsigned int time) noexcept;
96 std::size_t initial_size_;
97 std::vector<Person> people_;
99 std::vector<int> find_index_of_recyclables(
unsigned int time,
100 std::size_t top = 0) const noexcept;
Defines the virtual population data type.
Definition: population.h:14
ConstIteratorType end() const noexcept
Gets a read-only iterator to the element following the last Person of the population.
Definition: population.h:85
IteratorType end() noexcept
Gets an iterator to the element following the last Person of the population.
Definition: population.h:77
std::vector< Person >::iterator IteratorType
Population iterator.
Definition: population.h:17
ConstIteratorType cend() const noexcept
Gets a read-only iterator to the element following the last Person of the population.
Definition: population.h:93
std::size_t size() const noexcept
Gets the current size of the population.
Definition: population.cpp:7
std::vector< Person >::const_iterator ConstIteratorType
Read-only population iterator.
Definition: population.h:19
std::size_t initial_size() const noexcept
Gets the initial size of the population.
Definition: population.cpp:9
std::size_t current_active_size() const noexcept
Gets the current active size of the population.
Definition: population.cpp:11
ConstIteratorType cbegin() const noexcept
Gets an read-only iterator to the beginning of the virtual population.
Definition: population.h:89
Person & at(std::size_t index)
Gets a Person by index with bounds checking.
Definition: population.cpp:22
IteratorType begin() noexcept
Gets an iterator to the beginning of the virtual population.
Definition: population.h:73
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.
Definition: population.cpp:36
void add(Person &&person, unsigned int time) noexcept
Adds a Person to the virtual population.
Definition: population.cpp:26
ConstIteratorType begin() const noexcept
Gets an read-only iterator to the beginning of the virtual population.
Definition: population.h:81
Gender
Enumerates gender types.
Definition: forward_type.h:18
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
Global namespace.
Definition: jsonparser.h:88
Defines a virtual population person data type.
Definition: person.h:40