|
Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
|
Interface for any herbivore implementation in the model. More...
#include <herbivore_interface.h>
Public Member Functions | |
| virtual | ~HerbivoreInterface ()=default |
| Virtual destructor, which will be called by derived classes. More... | |
| virtual void | eat (const ForageMass &kg_per_km2, const Digestibility &digestibility, const ForageMass &N_kg_per_km2=ForageMass(0))=0 |
| Feed the herbivore dry matter forage. More... | |
| virtual double | get_bodymass () const =0 |
| Body mass of one individual [kg/ind]. More... | |
| virtual ForageMass | get_forage_demands (const HabitatForage &available_forage)=0 |
| Get the forage the herbivore would like to eat today. More... | |
| virtual std::string | get_output_group () const =0 |
| The name of the HFT for aggregating output. More... | |
| virtual double | get_ind_per_km2 () const =0 |
| Individuals per km² More... | |
| virtual double | get_kg_per_km2 () const =0 |
| Get herbivore biomass density [kg/km²]. More... | |
| virtual const Output::HerbivoreData & | get_todays_output () const =0 |
| Read current output. More... | |
| virtual bool | is_dead () const =0 |
| Whether the herbivore object is dead. More... | |
| virtual void | kill ()=0 |
| Mark this herbivore as dead (see is_dead()). More... | |
| virtual void | simulate_day (const int day, const HabitatEnvironment &environment, double &offspring)=0 |
| Simulate daily events. More... | |
Interface for any herbivore implementation in the model.
Derived classes will define the model mechanics. Each herbivore class has a corresponding implementation of PopulationInterface which creates and manages the herbivores.
|
virtualdefault |
Virtual destructor, which will be called by derived classes.
|
pure virtual |
Feed the herbivore dry matter forage.
| kg_per_km2 | Dry matter forage mass [kgDM/km²]. |
| N_kg_per_km2 | Nitrogen in the forage [kgN/km²]. |
| digestibility | Proportional forage digestibility. |
| std::logic_error | If forage exceeds intake constraints of maximal foraging and digestion. |
| std::logic_error | If this herbivore is dead or has no individuals. |
| std::invalid_argument | If N_kg_per_km2 is larger than kg_per_km2 for a forage type. The nitrogen mass is only a fraction of dry matter, and there cannot be more then 100% nitrogen in the forage. |
Implemented in Fauna::HerbivoreBase.
|
pure virtual |
Body mass of one individual [kg/ind].
Implemented in Fauna::HerbivoreBase.
|
pure virtual |
Get the forage the herbivore would like to eat today.
Call this after simulate_day().
| available_forage | Available forage in the habitat [kgDM/km²]. |
Implemented in Fauna::HerbivoreBase.
|
pure virtual |
Individuals per km²
Implemented in Fauna::HerbivoreCohort.
|
pure virtual |
Get herbivore biomass density [kg/km²].
Implemented in Fauna::HerbivoreBase.
|
pure virtual |
The name of the HFT for aggregating output.
Technically, this can be a generic identifier to aggregate output of herbivores. However, herbivores used to be aggregated only by HFT, and so this is assumed to be the HFT name until the output framework is made more flexible.
Implemented in Fauna::HerbivoreBase.
|
pure virtual |
Read current output.
Implemented in Fauna::HerbivoreBase.
|
pure virtual |
Whether the herbivore object is dead.
Implemented in Fauna::HerbivoreCohort.
|
pure virtual |
Mark this herbivore as dead (see is_dead()).
This function is needed in order to take nitrogen back from “dead” herbivores before removing them from memory.
Implemented in Fauna::HerbivoreCohort.
|
pure virtual |
Simulate daily events.
Call this before get_forage_demands().
| [in] | day | Current day of year, 0=Jan. 1st. |
| [in] | environment | Current environmental conditions in the habitat. |
| [out] | offspring | Number of newborn today [ind/km²]. |
| std::invalid_argument | If day not in [0,364]. |
| std::logic_error | If this herbivore is dead. |
Implemented in Fauna::HerbivoreBase.