Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Utopia::Models::PredatorPreyPlant::PlantParams Struct Reference

The parameters characterizing plants. More...

#include <species.hh>

Public Member Functions

 PlantParams (const Utopia::DataIO::Config &cfg)
 Construct a species from a configuration node.
 
 PlantParams ()=delete
 

Public Attributes

const GrowthModel growth_model
 The growth model of the plant.
 
const unsigned int regen_time
 The deterministic regeneration time.
 
const double regen_prob
 The regeneration probability, evaluated each time step.
 

Detailed Description

The parameters characterizing plants.

Constructor & Destructor Documentation

◆ PlantParams() [1/2]

Utopia::Models::PredatorPreyPlant::PlantParams::PlantParams ( const Utopia::DataIO::Config cfg)
inline

Construct a species from a configuration node.

52 :
53 // Set the growth model from the configuration
54 growth_model([&cfg](){
55 auto gm = get_as<std::string>("growth_model", cfg);
56 if (gm == "deterministic") return GrowthModel::deterministic;
57 else if (gm == "stochastic") return GrowthModel::stochastic;
58 else return GrowthModel::none;
59 }()),
60 // Extract regeneration time and probability
61 regen_time([&cfg](){
62 const auto t = get_as<int>("regen_time", cfg);
63 return t;
64 }()),
65 regen_prob(get_as<double>("regen_prob", cfg))
66 {};
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
@ none
Plant level is ignored; prey are always able to eat.
@ stochastic
Once eaten, a plant regrows with probability regen_prob
@ deterministic
Once eaten, a plant requires regen_time time to regenerate.
const unsigned int regen_time
The deterministic regeneration time.
Definition species.hh:44
const GrowthModel growth_model
The growth model of the plant.
Definition species.hh:41
const double regen_prob
The regeneration probability, evaluated each time step.
Definition species.hh:47

◆ PlantParams() [2/2]

Utopia::Models::PredatorPreyPlant::PlantParams::PlantParams ( )
delete

Member Data Documentation

◆ growth_model

const GrowthModel Utopia::Models::PredatorPreyPlant::PlantParams::growth_model

The growth model of the plant.

◆ regen_prob

const double Utopia::Models::PredatorPreyPlant::PlantParams::regen_prob

The regeneration probability, evaluated each time step.

◆ regen_time

const unsigned int Utopia::Models::PredatorPreyPlant::PlantParams::regen_time

The deterministic regeneration time.


The documentation for this struct was generated from the following file: