Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
fatmass_energy_budget.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_FATMASS_ENERGY_BUDGET_H
12#define FAUNA_FATMASS_ENERGY_BUDGET_H
13
14namespace Fauna {
15
17
24 public:
26
38 FatmassEnergyBudget(const double initial_fatmass,
39 const double maximum_fatmass,
40 const double anabolism_coefficient,
41 const double catabolism_coefficient);
42
44
46 void add_energy_needs(const double energy);
47
49 void catabolize_fat();
50
52
58 void force_body_condition(const double body_condition);
59
61 double get_energy_needs() const { return energy_needs; }
62
64 double get_fatmass() const { return fatmass; }
65
67 double get_max_anabolism_per_day() const;
68
70 double get_max_fatmass() const { return max_fatmass; }
71
73
78 void merge(const FatmassEnergyBudget& other, const double this_weight,
79 const double other_weight);
80
82
90 void metabolize_energy(double energy);
91
93
101 void set_max_fatmass(const double max_fatmass, const double max_gain);
102
103 private:
104 double anabolism_coefficient; // MJ/kg
105 double catabolism_coefficient; // MJ/kg
106 double energy_needs = 0.0; // MJ/ind
107 double fatmass; // kg/ind
108 double max_fatmass; // kg/ind
109 double max_fatmass_gain = 0.0; // kg/ind/day
110};
111} // namespace Fauna
112#endif // FAUNA_FATMASS_ENERGY_BUDGET_H
A herbivore’s energy budget with fat reserves.
Definition: fatmass_energy_budget.h:23
double max_fatmass
Definition: fatmass_energy_budget.h:108
double fatmass
Definition: fatmass_energy_budget.h:107
void catabolize_fat()
Burn fat reserves and reduce unmet energy needs.
Definition: fatmass_energy_budget.cpp:56
double energy_needs
Definition: fatmass_energy_budget.h:106
double max_fatmass_gain
Definition: fatmass_energy_budget.h:109
void force_body_condition(const double body_condition)
Set the proportional fat reserves.
Definition: fatmass_energy_budget.cpp:71
double get_fatmass() const
Current fat mass [kg/ind].
Definition: fatmass_energy_budget.h:64
double get_max_anabolism_per_day() const
Get the maximum energy [MJ/ind/day] that could be anabolized in a day.
Definition: fatmass_energy_budget.cpp:79
double catabolism_coefficient
Definition: fatmass_energy_budget.h:105
void set_max_fatmass(const double max_fatmass, const double max_gain)
Set the maximum allowed fat mass [kg/ind] and fat gain [kg/ind/day].
Definition: fatmass_energy_budget.cpp:136
double get_energy_needs() const
Current energy needs [MJ/ind].
Definition: fatmass_energy_budget.h:61
double get_max_fatmass() const
Maximum fat mass [kg/ind].
Definition: fatmass_energy_budget.h:70
void merge(const FatmassEnergyBudget &other, const double this_weight, const double other_weight)
Merge this object with another one by building weighted averages.
Definition: fatmass_energy_budget.cpp:92
double anabolism_coefficient
Definition: fatmass_energy_budget.h:104
void metabolize_energy(double energy)
Update budget and fat mass by receiving energy (through feeding)
Definition: fatmass_energy_budget.cpp:104
void add_energy_needs(const double energy)
Increase energy needs.
Definition: fatmass_energy_budget.cpp:48
Definition: average.h:16