|
Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
|
Function object to simulate one day in one habitat. More...
#include <simulate_day.h>
Public Member Functions | |
| SimulateDay (const int day_of_year, SimulationUnit &simulation_unit, const FeedHerbivores &feed_herbivores) | |
| Constructor. More... | |
| void | operator() (const bool do_herbivores, const bool establish_as_needed) |
| Simulate one day. More... | |
Private Member Functions | |
| void | create_offspring () |
| Create the offspring counted in total_offspring. More... | |
| void | simulate_herbivores () |
| Iterate over all herbivores and let them do their simulation. More... | |
Static Private Member Functions | |
| static HabitatForage | get_corrected_forage (const Habitat &) |
| Read available forage and set it to zero if it is very low. More... | |
| static std::map< PopulationInterface *, HerbivoreVector > | get_herbivores (const PopulationList &) |
| Get references to all herbivores in the list of populations. More... | |
Private Attributes | |
| const int | day_of_year |
| Julian day of year (0 = Jan 1st). More... | |
| const HabitatEnvironment | environment |
| The current abiotic conditions. More... | |
| const FeedHerbivores & | feed_herbivores |
| Function object doing the feeding. More... | |
| std::map< PopulationInterface *, HerbivoreVector > | herbivores |
| Pointers to all herbivores in the habitat. More... | |
| std::map< PopulationInterface *, double > | total_offspring |
| All offspring for each population today [ind/km²]. More... | |
| SimulationUnit & | simulation_unit |
| Reference to the simulation unit. More... | |
Function object to simulate one day in one habitat.
This class is very high in the framework hierarchy and should therefore be kept as slim as possible. It should only call well encapsulated other functions and classes.
| SimulateDay::SimulateDay | ( | const int | day_of_year, |
| SimulationUnit & | simulation_unit, | ||
| const FeedHerbivores & | feed_herbivores | ||
| ) |
Constructor.
| day_of_year | Current day of year (0 = Jan 1st) |
| simulation_unit | The habitat and herbivores to simulate. |
| feed_herbivores | Function object used to give forage to the herbivores. |
| std::invalid_argument | If day_of_year not in [0,364]. |
|
private |
Create the offspring counted in total_offspring.
For each HFT, let the PopulationInterface object create herbivores. These new herbivores will be counted in the output next simulation cycle.
|
staticprivate |
|
staticprivate |
Get references to all herbivores in the list of populations.
| void SimulateDay::operator() | ( | const bool | do_herbivores, |
| const bool | establish_as_needed | ||
| ) |
Simulate one day.
| do_herbivores | Whether the herbivore objects shall be simulated. Otherwise only the habitat is initialized. |
| establish_as_needed | Whether to (re-)establish herbivores in those populations that are empty. This only has effect if also do_herbivores==true |
|
private |
Iterate over all herbivores and let them do their simulation.
Call HerbivoreInterface::simulate_day() in each alive herbivore object. Also collect offspring.
|
private |
Julian day of year (0 = Jan 1st).
|
private |
The current abiotic conditions.
|
private |
Function object doing the feeding.
|
private |
Pointers to all herbivores in the habitat.
|
private |
Reference to the simulation unit.
|
private |
All offspring for each population today [ind/km²].