Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
get_forage_demands.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 W. Traylor <wolfgang.traylor@senckenberg.de>
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
11#ifndef FAUNA_GET_FORAGE_DEMANDS_H
12#define FAUNA_GET_FORAGE_DEMANDS_H
13
14#include <memory>
15#include "forage_values.h"
16#include "habitat_forage.h"
17
18namespace Fauna {
19class Hft;
20enum class Sex;
21
23
27 public:
29
34 GetForageDemands(std::shared_ptr<const Hft> hft, const Sex sex);
35
37
42 void add_eaten(ForageMass eaten_forage);
43
45
57 const ForageFraction& mj_proportions,
58 const ForageEnergyContent& mj_per_kg, const double kg_total);
59
61
73 void init_today(const int day, const HabitatForage& available_forage,
75 const double bodymass);
76
78
79 bool is_day_initialized(const int day) const;
80
82
91
92 private:
94 double get_bodymass_adult() const;
95
97 const Hft& get_hft() const {
98 assert(hft != NULL);
99 return *hft;
100 }
101
103
134
136
150
153
168
170
172 int get_today() const;
173
174 const std::shared_ptr<const Hft> hft;
175 const Sex sex;
176
178 double bodymass;
184 int today;
185};
186
187} // namespace Fauna
188
189#endif // FAUNA_GET_FORAGE_DEMANDS_H
Function object to calculate forage demands for a herbivore.
Definition: get_forage_demands.h:26
const Hft & get_hft() const
The herbivore functional type.
Definition: get_forage_demands.h:97
ForageMass max_intake
[MJ/ind]
Definition: get_forage_demands.h:183
HabitatForage available_forage
Definition: get_forage_demands.h:177
ForageFraction get_diet_composition() const
Get energy-wise preferences for forage types.
Definition: get_forage_demands.cpp:53
const Sex sex
Definition: get_forage_demands.h:175
double get_bodymass_adult() const
Adult herbivore body mass [kg/ind].
Definition: get_forage_demands.cpp:29
ForageEnergyContent energy_content
[frac.]
Definition: get_forage_demands.h:181
void add_eaten(ForageMass eaten_forage)
Register ingested forage so that less forage will be demanded.
Definition: get_forage_demands.cpp:36
ForageFraction diet_composition
[kg/ind]
Definition: get_forage_demands.h:179
bool is_day_initialized(const int day) const
Whether the given day has been initialized with init_today().
Definition: get_forage_demands.cpp:284
Digestibility digestibility
[frac.] sum = 1.0
Definition: get_forage_demands.h:180
ForageMass get_max_digestion() const
Maximum forage [kgDM/ind/day] that could be potentially digested.
Definition: get_forage_demands.cpp:80
int today
[kgDM/ind/day]
Definition: get_forage_demands.h:184
double bodymass
Definition: get_forage_demands.h:178
int get_today() const
Current day of the year, as set in init_today().
Definition: get_forage_demands.cpp:219
ForageMass get_max_foraging() const
Definition: get_forage_demands.cpp:125
ForageMass operator()(const double energy_needs)
Calculate current forage demands.
Definition: get_forage_demands.cpp:296
const std::shared_ptr< const Hft > hft
Definition: get_forage_demands.h:174
static ForageMass get_max_intake_as_total_mass(const ForageFraction &mj_proportions, const ForageEnergyContent &mj_per_kg, const double kg_total)
Get maximum intake for each forage type limited by total mass.
Definition: get_forage_demands.cpp:184
double energy_needs
[MJ/kgDM]
Definition: get_forage_demands.h:182
void init_today(const int day, const HabitatForage &available_forage, const ForageEnergyContent &energy_content, const double bodymass)
Initialize foraging for another day.
Definition: get_forage_demands.cpp:229
All values for large herbivore forage in a Habitat.
Definition: habitat_forage.h:21
One herbivore functional type (i.e. one species).
Definition: hft.h:310
Basic classes encapsulating forage amounts & fractions.
Forage in a habitat.
Definition: average.h:16
Sex
The sex of a herbivore.
Definition: herbivore_base.h:25