A herbivore habitat independent of the LPJ-GUESS framework for testing.
More...
#include <simple_habitat.h>
A herbivore habitat independent of the LPJ-GUESS framework for testing.
◆ SimpleHabitat()
Constructor with simulation settings.
- Parameters
-
| settings | Simulation settings for the vegetation model. |
| aggregation_unit | An arbitrary name for grouping the habitat for output. |
◆ add_excreted_nitrogen()
| virtual void Fauna::Demo::SimpleHabitat::add_excreted_nitrogen |
( |
const double |
| ) |
|
|
inlinevirtual |
◆ get_aggregation_unit()
| virtual const char * Fauna::Demo::SimpleHabitat::get_aggregation_unit |
( |
| ) |
const |
|
inlinevirtual |
A string identifier for the group of habitats whose output is aggregated.
Suppose the vegetation model works in longitude/latitude grid cells and has three habitats in each grid cell. Output shall be aggregated per grid cell. Then all habitats in each set of three have the same (unique!) aggregation unit sting identifier. This could be for instance "10.0/54.0" for a grid cell at 10° E and 54° N. It’s completely up to the vegetation model to define a convention for the aggregation unit identifiers.
You should avoid leading or trailing whitespaces and take care that you don’t include a character that is used as a field separator in the output table. Also, the string should not be empty.
The output of this function should not change within the lifetime of one class instance: One Habitat object shall not change into another aggregation unit.
Implements Fauna::Habitat.
◆ get_available_forage()
| virtual HabitatForage Fauna::Demo::SimpleHabitat::get_available_forage |
( |
| ) |
const |
|
inlinevirtual |
Get dry-matter biomass [kgDM/km²] that is available to herbivores to eat.
- Exceptions
-
| std::logic_error | If this object is dead. |
Implements Fauna::Habitat.
◆ get_environment()
Get today’s abiotic environmental variables in the habitat.
- Exceptions
-
| std::logic_error | If this object is dead. |
Implements Fauna::Habitat.
◆ grow_daily()
| virtual void Fauna::Demo::SimpleHabitat::grow_daily |
( |
const int |
day_of_year | ) |
|
|
inlineprotectedvirtual |
Perform daily growth.
- Parameters
-
| day_of_year | January 1st = 0 |
◆ init_day()
| void SimpleHabitat::init_day |
( |
const int |
today | ) |
|
|
virtual |
Update at the start of the day.
Call this once every day from the framework. When overwriting this in derived classes, make sure to call this parent function first.
- Parameters
-
| today | Day of the year (0 ≙ Jan 1st). |
- Exceptions
-
| std::invalid_argument | If not 0<=today<=364. |
| std::logic_error | If this object is dead. |
Reimplemented from Fauna::Habitat.
◆ remove_eaten_forage()
| void SimpleHabitat::remove_eaten_forage |
( |
const ForageMass & |
eaten_forage | ) |
|
|
virtual |
Remove forage eaten by herbivores.
The base class implements only adding the eaten forage to the output. Any derived class should call this (the parent‘s) function and do forage removal afterwards.
- Note
- It is the vegetation model’s responsibility to recycle nutrients (e.g. nitrogen). Even though the herbivore model counts the amount of ingested nitrogen, it does not close the nutrient cycle by returning nitrogen to the vegetation. The implementation of this function could directly put eaten nitrogen into the soil, thereby ignoring the (short) time herbivores retain nitrogen in their digestive tract and their body tissue.
- Parameters
-
| eaten_forage | Dry matter leaf forage [kgDM/km²], must not exceed available forage. |
- Exceptions
-
| std::logic_error | If eaten_forage exceeds available forage (to be implemented in derived classes). |
| std::logic_error | If this object is dead. |
Reimplemented from Fauna::Habitat.
◆ aggregation_unit
| const std::string Fauna::Demo::SimpleHabitat::aggregation_unit |
|
private |
◆ air_temperature
| double Fauna::Demo::SimpleHabitat::air_temperature = 0.0 |
|
private |
◆ grass
◆ settings
◆ simulation_month
| int Fauna::Demo::SimpleHabitat::simulation_month = 0 |
|
private |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/modular-megafauna-model/checkouts/latest/tools/demo_simulator/simple_habitat.h
- /home/docs/checkouts/readthedocs.org/user_builds/modular-megafauna-model/checkouts/latest/tools/demo_simulator/simple_habitat.cpp