Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
simulate_day.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_SIMULATE_DAY_H
12#define FAUNA_SIMULATE_DAY_H
13
14#include <map>
15#include "environment.h"
16#include "habitat_forage.h"
17#include "herbivore_vector.h"
18#include "population_list.h"
19
20namespace Fauna {
21// Forward declarations
22class FeedHerbivores;
23class Habitat;
24class PopulationInterface;
25class SimulationUnit;
26
28
34 public:
36
46
48
61 void operator()(const bool do_herbivores, const bool establish_as_needed);
62
63 private: // HELPER FUNCTIONS
65
70 void create_offspring();
71
73
81
83 static std::map<PopulationInterface*, HerbivoreVector> get_herbivores(
84 const PopulationList&);
85
87
92
93 private: // MEMBER VARIABLES
95 const int day_of_year;
96
99
102
104 std::map<PopulationInterface*, HerbivoreVector> herbivores;
105
107 std::map<PopulationInterface*, double> total_offspring;
108
111};
112} // namespace Fauna
113
114#endif // FAUNA_SIMULATE_DAY_H
Function object to feed herbivores.
Definition: feed_herbivores.h:23
All values for large herbivore forage in a Habitat.
Definition: habitat_forage.h:21
Abstract class of a homogenous spatial unit populated by herbivores.
Definition: habitat.h:29
Function object to simulate one day in one habitat.
Definition: simulate_day.h:33
std::map< PopulationInterface *, HerbivoreVector > herbivores
Pointers to all herbivores in the habitat.
Definition: simulate_day.h:104
static std::map< PopulationInterface *, HerbivoreVector > get_herbivores(const PopulationList &)
Get references to all herbivores in the list of populations.
Definition: simulate_day.cpp:53
SimulationUnit & simulation_unit
Reference to the simulation unit.
Definition: simulate_day.h:110
void operator()(const bool do_herbivores, const bool establish_as_needed)
Simulate one day.
Definition: simulate_day.cpp:63
void simulate_herbivores()
Iterate over all herbivores and let them do their simulation.
Definition: simulate_day.cpp:120
std::map< PopulationInterface *, double > total_offspring
All offspring for each population today [ind/km²].
Definition: simulate_day.h:107
const int day_of_year
Julian day of year (0 = Jan 1st).
Definition: simulate_day.h:95
static HabitatForage get_corrected_forage(const Habitat &)
Read available forage and set it to zero if it is very low.
Definition: simulate_day.cpp:40
void create_offspring()
Create the offspring counted in total_offspring.
Definition: simulate_day.cpp:32
const HabitatEnvironment environment
The current abiotic conditions.
Definition: simulate_day.h:98
const FeedHerbivores & feed_herbivores
Function object doing the feeding.
Definition: simulate_day.h:101
A habitat with the herbivores that live in it.
Definition: simulation_unit.h:27
Classes for abiotic conditions for herbivores.
Forage in a habitat.
Type definitions of vectors of herbivore pointers.
Definition: average.h:16
std::vector< std::shared_ptr< PopulationInterface > > PopulationList
Definition: population_list.h:21
A list of herbivore populations in a habitat.
Variables describing the habitat that are not forage ⇒ abiotic environment.
Definition: environment.h:16