Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
logistic_grass.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_DEMO_LOGISTIC_GRASS_H
12#define FAUNA_DEMO_LOGISTIC_GRASS_H
13#include <string>
14#include <vector>
15#include "megafauna.h"
16
17namespace Fauna {
18namespace Demo {
19
22
26 public:
28
31 struct Parameters {
33
38 std::vector<double> decay_monthly = {0.0};
39
41
46 std::vector<double> digestibility = {0.5};
47
49 double fpc = 0.1;
50
52
57 std::vector<double> growth_monthly = {0.0};
58
60
61 double init_mass = 0.0;
62
64
65 double reserve = 0.1;
66
68
69 double saturation = 1.0;
70
72
76 bool is_valid(std::string& msg) const;
77 };
78
80
84
86
90 void grow_daily(const int day_of_year);
91
93 const GrassForage& get_forage() const { return forage; }
94
96 void set_forage(const GrassForage& f) { forage = f; }
97
98 private:
100
102
104
106
111};
112
113} // namespace Demo
114} // namespace Fauna
115
116#endif // FAUNA_DEMO_LOGISTIC_GRASS_H
Definition: logistic_grass.h:25
GrassForage forage
Current forage.
Definition: logistic_grass.h:101
const GrassForage & get_forage() const
Get current grass forage.
Definition: logistic_grass.h:93
LogisticGrass::Parameters settings
Definition: logistic_grass.h:103
void grow_daily(const int day_of_year)
Perform grass growth and decay for one day.
Definition: logistic_grass.cpp:123
void set_forage(const GrassForage &f)
Set the grass forage.
Definition: logistic_grass.h:96
int simulation_month
The current simulation month, starting with zero.
Definition: logistic_grass.h:110
Grass forage in a habitat.
Definition: grass_forage.h:19
Public header for the Modular Megafauna Model.
Definition: average.h:16
Settings for grass growth.
Definition: logistic_grass.h:31
std::vector< double > growth_monthly
Proportional daily grass growth rates [day^-1].
Definition: logistic_grass.h:57
double fpc
Fraction of habitat/patch covered with grass [frac].
Definition: logistic_grass.h:49
std::vector< double > digestibility
Proportional digestibility of the grass [frac].
Definition: logistic_grass.h:46
bool is_valid(std::string &msg) const
Check if parameters are valid.
Definition: logistic_grass.cpp:16
std::vector< double > decay_monthly
Proportional daily rates of grass decay [day^-1].
Definition: logistic_grass.h:38
double saturation
Saturation grass biomass [kgDM/m²].
Definition: logistic_grass.h:69
double init_mass
Initial available forage [kgDM/km²].
Definition: logistic_grass.h:61
double reserve
Ungrazable grass biomass reserve, inaccessable to herbivores [kgDM/km²].
Definition: logistic_grass.h:65