Function object to calculate forage demands for a herbivore.
More...
#include <get_forage_demands.h>
Function object to calculate forage demands for a herbivore.
- See also
- HerbivoreInterface::get_forage_demands()
◆ GetForageDemands()
| GetForageDemands::GetForageDemands |
( |
std::shared_ptr< const Hft > |
hft, |
|
|
const Sex |
sex |
|
) |
| |
Constructor.
- Parameters
-
| hft | Herbivore functional type. |
| sex | The sex of the herbivore cohort. |
- Exceptions
-
| std::invalid_argument | If hft==NULL. |
◆ add_eaten()
| void GetForageDemands::add_eaten |
( |
ForageMass |
eaten_forage | ) |
|
Register ingested forage so that less forage will be demanded.
- Parameters
-
| eaten_forage | Ingested plant material [kgDM/ind]. |
- Exceptions
-
| std::logic_error | If eaten_forage exceeds the maximum intake of today. |
◆ get_bodymass_adult()
| double GetForageDemands::get_bodymass_adult |
( |
| ) |
const |
|
private |
Adult herbivore body mass [kg/ind].
◆ get_diet_composition()
Get energy-wise preferences for forage types.
To what fractions the different forage types are eaten (in sum the fractions must be 1.0).
Hft::foraging_diet_composer defines the algorithm used to put together the fractions of different forage types in the preferred diet for each day. Note that this function may be called several times a day in cases of food scarcity, when the available forage needs to be split among herbivores according to their needs (see DistributeForage). This allows for switching to another, less preferred, forage type if the first choice is not available anymore.
This is the ad-libidum diet according to the preferences of the HFT. The fractions refer to energy, not mass. The composition is set, i.e. that the demanded forage will be put together accordingly. In case of forage shortage in the habitat, there is the chance to switch to other forage types when the demands are queried again in the same day. (⇒ see Fauna::DistributeForage).
- Returns
- Energy fractions of forage types composing current diet; the sum is 1.0.
- Exceptions
-
| std::logic_error | If the Hft::foraging_diet_composer is not implemented. |
| std::logic_error | If the selected algorithm does not produce a sum of fractions that equals 1.0 (100%). |
◆ get_hft()
| const Hft & Fauna::GetForageDemands::get_hft |
( |
| ) |
const |
|
inlineprivate |
The herbivore functional type.
◆ get_max_digestion()
| ForageMass GetForageDemands::get_max_digestion |
( |
| ) |
const |
|
private |
Maximum forage [kgDM/ind/day] that could be potentially digested.
The algorithm selected by Hft::digestion_limit is employed. Note that this is only the digestion-limited maximum intake. It does not consider metabolic needs (“hunger”, compare FatmassEnergyBudget::get_energy_needs()) nor foraging capabilities (get_max_foraging()) nor actual available forage.
- Returns
- Maximum digestible dry matter today with given forage composition [kgDM/ind/day].
- Exceptions
-
◆ get_max_foraging()
| ForageMass GetForageDemands::get_max_foraging |
( |
| ) |
const |
|
private |
Get the amount of forage the herbivore would be able to harvest [kgDM/day/ind]. The relative amount of each forage type is prescribed, and the absolute mass that the herbivore could potentially ingest is returned. This does not consider digestive limits or actual metabolic needs (“hunger”), but only considers the harvesting efficiency of the herbivore this day.
Each forage type is calculated separately and independently.
- Returns
- Maximum potentially harvested dry matter mass of each forage type [kgDM/day/ind].
- Exceptions
-
◆ get_max_intake_as_total_mass()
Get maximum intake for each forage type limited by total mass.
- Parameters
-
| mj_proportions | Diet composition in energy proportions [MJ/MJ]. |
| mj_per_kg | Energy content of forage [MJ/kgDM]. |
| kg_total | The maximum total intake [kgDM/day]. |
- Returns
- The maximum intake for each forage type [kgDM/day] while retaining the given relative energy proportions.
- Exceptions
-
| std::invalid_argument | If kg_total < 0.0. |
| std::invalid_argument | If mj_proportions.sum() != 1.0. |
- See also
- DigestiveLimit::Allometric
◆ get_today()
| int GetForageDemands::get_today |
( |
| ) |
const |
|
private |
Current day of the year, as set in init_today().
- Exceptions
-
| std::logic_error | If current day not yet set by an initial call to init_today(). |
◆ init_today()
Initialize foraging for another day.
- Calculate the diet composition with different forage types.
- Set max_intake to the minimum of digestive and foraging constraints.
- Parameters
-
| available_forage | The forage in the habitat. |
| day | Current day of year, 0=Jan. 1st. |
| bodymass | Current live weight body mass [kg/ind]. |
| energy_content | Net energy content of the available forage [MJ/kgDM]. |
- Exceptions
-
| std::invalid_argument | If day not in [0,364] or if bodymass<=0. |
◆ is_day_initialized()
| bool GetForageDemands::is_day_initialized |
( |
const int |
day | ) |
const |
Whether the given day has been initialized with init_today().
- Exceptions
-
| std::invalid_argument | If day<0 || day>364. |
◆ operator()()
| ForageMass GetForageDemands::operator() |
( |
const double |
energy_needs | ) |
|
Calculate current forage demands.
Call this only after init_today().
- Returns
- Forage [kgDM/ind/day] demanded by the herbivore today. This will not exceed the available forage in the patch.
- Exceptions
-
| std::logic_error | If init_today() hasn’t been called yet. |
| std::invalid_argument | If energy_needs < 0.0. |
◆ available_forage
◆ bodymass
| double Fauna::GetForageDemands::bodymass |
|
private |
◆ diet_composition
◆ digestibility
◆ energy_content
◆ energy_needs
| double Fauna::GetForageDemands::energy_needs |
|
private |
◆ hft
| const std::shared_ptr<const Hft> Fauna::GetForageDemands::hft |
|
private |
◆ max_intake
◆ sex
| const Sex Fauna::GetForageDemands::sex |
|
private |
◆ today
| int Fauna::GetForageDemands::today |
|
private |
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/get_forage_demands.h
- /home/docs/checkouts/readthedocs.org/user_builds/modular-megafauna-model/checkouts/latest/src/Fauna/get_forage_demands.cpp