|
Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
|
Helper class of World to create various megafauna components. More...
#include <world_constructor.h>
Public Member Functions | |
| WorldConstructor (const std::shared_ptr< const Parameters > params, const HftList &hftlist) | |
| Constructor: only set member variables. More... | |
| PopulationList * | create_populations (const unsigned int habitat_ctr_in_agg_unit) const |
| Instantiate populations for all HFTs in one Habitat. More... | |
| DistributeForage * | create_distribute_forage () const |
| Create new DistributeForage object according to parameters. More... | |
| const HftList & | get_hftlist () const |
| Get herbivore functional types. More... | |
| const Parameters & | get_params () const |
| Get global parameters. More... | |
Private Attributes | |
| const std::shared_ptr< const Parameters > | params |
| const HftList & | hftlist |
Helper class of World to create various megafauna components.
We separate World and WorldConstructor into two classes because the framework class World should be as slim as possible because it is exposed in the library interface. Moreover, World cannot be easily unit-tested since it is constructed with an external instruction file.
| WorldConstructor::WorldConstructor | ( | const std::shared_ptr< const Parameters > | params, |
| const HftList & | hftlist | ||
| ) |
Constructor: only set member variables.
| DistributeForage * WorldConstructor::create_distribute_forage | ( | ) | const |
Create new DistributeForage object according to parameters.
| PopulationList * WorldConstructor::create_populations | ( | const unsigned int | habitat_ctr_in_agg_unit | ) | const |
Instantiate populations for all HFTs in one Habitat.
| habitat_ctr_in_agg_unit | Habitat counter in aggregation unit. The habitat index (starting with 0) in the current aggregation unit (e.g. grid cell). If Parameters::one_hft_per_habitat == true, the counter indicates which HFT is to be created: A value of 0 will create one population with the first HFT in hftlist; 1 will create the second, 3 the third. Suppose there are 3 HFTs in the list, a value of 3 will create the first HFT again; 4 the second, and so forth. |
| std::logic_error | if Parameters::herbivore_type is not implemented |
|
inline |
Get herbivore functional types.
|
inline |
Get global parameters.
|
private |
|
private |