1#ifndef UTOPIA_MODELS_PREDATORPREY_SPECIES_HH
2#define UTOPIA_MODELS_PREDATORPREY_SPECIES_HH
61 throw std::invalid_argument(
"Parameter repro_cost needs to be "
62 "smaller than or equal to the minimal resources required for "
YAML::Node Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition types.hh:71
ReturnType get_as(const std::string &key, const DataIO::Config &node)
This function is a wrapper around the yaml-cpp YAML::Node::as function.
Definition cfg_utils.hh:158
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
Definition PredatorPrey.hh:17
Struct that holds all predator-specific parameters.
Definition species.hh:71
PredatorParams()=delete
The default constructor.
PredatorParams(const Utopia::DataIO::Config &cfg)
Construct a predator object from a configuration node.
Definition species.hh:74
Struct that holds all prey-species specific parameters.
Definition species.hh:84
PreyParams(const Utopia::DataIO::Config &cfg)
Construct a prey object from a configuration node.
Definition species.hh:91
double p_flee
Probability to flee from a predator if on the same cell.
Definition species.hh:87
PreyParams()=delete
The default constructor.
Struct that holds all species-specific parameters.
Definition species.hh:27
double resource_intake
Resource intake from eating.
Definition species.hh:33
double repro_cost
Cost of reproduction.
Definition species.hh:43
double resource_max
Maximal resource level.
Definition species.hh:39
SpeciesBaseParams()=delete
double cost_of_living
Cost of living that is taken each time step.
Definition species.hh:30
double repro_resource_requ
Minimal reproduction resources requirements.
Definition species.hh:36
SpeciesBaseParams(const Utopia::DataIO::Config &cfg)
Load species parameters from a configuration node.
Definition species.hh:50
double repro_prob
Reproduction probability.
Definition species.hh:46
The parameter of all species.
Definition species.hh:106
SpeciesParams()=delete
Default constructor.
PredatorParams predator
Predator parameters.
Definition species.hh:111
PreyParams prey
Prey parameters.
Definition species.hh:108
SpeciesParams(const Utopia::DataIO::Config &cfg)
Construct through a configuration file.
Definition species.hh:115
Struct that holds all species states.
Definition species.hh:11
double resources
The internal resources reservoir.
Definition species.hh:16
SpeciesState()
The default constructor.
Definition species.hh:20
bool on_cell
Whether the species is on the cell.
Definition species.hh:13