|
Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
|
A container of herbivore objects. More...
#include <population_interface.h>
Public Member Functions | |
| virtual | ~PopulationInterface () |
| Virtual destructor. More... | |
| virtual void | create_offspring (const double ind_per_km2)=0 |
| Give birth to new herbivores. More... | |
| virtual void | establish ()=0 |
| Create a set of new herbivores to establish a population. More... | |
| virtual const double | get_ind_per_km2 () const |
| Get individual density of all herbivores together [ind/km²]. More... | |
| virtual const double | get_kg_per_km2 () const |
| Get mass density of all herbivores together [kg/km²]. More... | |
| virtual ConstHerbivoreVector | get_list () const =0 |
| Get pointers to the herbivores (including dead ones). More... | |
| virtual HerbivoreVector | get_list ()=0 |
| Get pointers to the herbivores (including dead ones). More... | |
| virtual void | kill_all () |
| Mark all herbivores as dead (see HerbivoreInterface::kill()). More... | |
| virtual void | kill_nonviable ()=0 |
| Mark those herbivores as dead that are not viable. More... | |
| virtual void | purge_of_dead ()=0 |
| Delete all dead herbivores. More... | |
A container of herbivore objects.
Manages a set of HerbivoreInterface instances. What makes a "population" may be defined by the derived class. For instance, herbivore cohorts have one population per HFT in each simulation unit.
A population also instantiates all new objects of herbivore classes (derived from HerbivoreInterface) in a simulation.
|
inlinevirtual |
Virtual destructor.
Destructor must be virtual in an interface.
|
pure virtual |
Give birth to new herbivores.
The new herbivores are owned by this population object.
| ind_per_km2 | Offspring amount [ind/km²]. |
| std::invalid_argument | If offspring<0.0. |
Implemented in Fauna::CohortPopulation.
|
pure virtual |
Create a set of new herbivores to establish a population.
| std::logic_error | If this population is not empty. |
Implemented in Fauna::CohortPopulation.
|
virtual |
Get individual density of all herbivores together [ind/km²].
|
virtual |
Get mass density of all herbivores together [kg/km²].
|
pure virtual |
Get pointers to the herbivores (including dead ones).
Implemented in Fauna::CohortPopulation.
|
pure virtual |
Get pointers to the herbivores (including dead ones).
Implemented in Fauna::CohortPopulation.
|
virtual |
Mark all herbivores as dead (see HerbivoreInterface::kill()).
|
pure 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.
Implemented in Fauna::CohortPopulation.
|
pure virtual |
Delete all dead herbivores.
Implemented in Fauna::CohortPopulation.