A population of HerbivoreCohort objects.
More...
#include <cohort_population.h>
A population of HerbivoreCohort objects.
◆ List
◆ CohortPopulation()
Constructor.
- Parameters
-
- Exceptions
-
| std::invalid_argument | if any parameter is wrong. |
◆ create_offspring()
| void CohortPopulation::create_offspring |
( |
const double |
ind_per_km2 | ) |
|
|
virtual |
Give birth to new herbivores.
The new herbivores are owned by this population object.
- Parameters
-
| ind_per_km2 | Offspring amount [ind/km²]. |
- Exceptions
-
| std::invalid_argument | If offspring<0.0. |
Implements Fauna::PopulationInterface.
◆ create_offspring_by_sex()
| void CohortPopulation::create_offspring_by_sex |
( |
const Sex |
sex, |
|
|
double |
ind_per_km2 |
|
) |
| |
|
private |
Add newborn animals to the population either males or females.
If no newborn cohort (age in years = zero) exists yet, it will be created. Otherwise, the additional newborns will be merged into the existing newborn cohort. The age in days of the existing cohort will not be changed.
- See also
- HerbivoreCohort::merge()
-
create_offspring()
◆ establish()
| void CohortPopulation::establish |
( |
| ) |
|
|
virtual |
Create a set of new herbivores to establish a population.
- Exceptions
-
| std::logic_error | If this population is not empty.
|
Implements Fauna::PopulationInterface.
◆ find_cohort()
| CohortPopulation::List::iterator CohortPopulation::find_cohort |
( |
const int |
age_years, |
|
|
const Sex |
sex |
|
) |
| |
|
private |
Find a cohort in the list.
- Parameters
-
| age_years | Age-class number (0=first year of life). |
| sex | Male or female cohort? |
- Returns
- If found: iterator pointing to the HerbivoreCohort object. If not found: end() iterator of the cohort list.
◆ get_hft()
| virtual const Hft & Fauna::CohortPopulation::get_hft |
( |
| ) |
const |
|
inlinevirtual |
◆ get_list() [1/2]
Get pointers to the herbivores (including dead ones).
- Warning
- The pointers are not guaranteed to stay valid on changing the population in create_offspring() or establish().
- Returns
- Pointers to all living herbivores in the population. Guaranteed no NULL pointers.
Implements Fauna::PopulationInterface.
◆ get_list() [2/2]
Get pointers to the herbivores (including dead ones).
- Warning
- The pointers are not guaranteed to stay valid on changing the population in create_offspring() or establish().
- Returns
- Pointers to all living herbivores in the population. Guaranteed no NULL pointers.
Implements Fauna::PopulationInterface.
◆ kill_nonviable()
| void CohortPopulation::kill_nonviable |
( |
| ) |
|
|
virtual |
Mark those herbivores as dead that are not viable.
The first step is to mark non-viable herbivores as dead (see HerbivoreInterface::kill()). In the second step, dead herbivores are removed. It is necessary to split this up so that the simulation framework can do something with dead herbivores before they are deleted in purge_of_dead(). For example this may be returning nitrogen.
Implements Fauna::PopulationInterface.
◆ purge_of_dead()
| void CohortPopulation::purge_of_dead |
( |
| ) |
|
|
virtual |
◆ create_cohort
◆ list
| List Fauna::CohortPopulation::list |
|
private |
Offspring accumulated until above minimum threshold [ind/km²].
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/modular-megafauna-model/checkouts/latest/src/Fauna/cohort_population.h
- /home/docs/checkouts/readthedocs.org/user_builds/modular-megafauna-model/checkouts/latest/src/Fauna/cohort_population.cpp