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::ForestFire::Param Struct Reference

ForestFire model parameter struct. More...

#include <ForestFire.hh>

Public Member Functions

 Param (const DataIO::Config &cfg)
 Construct the parameters from the given configuration node.
 

Public Attributes

const double p_growth
 Rate of growth per cell.
 
const double p_lightning
 Frequency of lightning occurring per cell.
 
const double p_immunity
 The probability (per neighbor) to be immune to a spreading fire.
 

Detailed Description

ForestFire model parameter struct.

Constructor & Destructor Documentation

◆ Param()

Utopia::Models::ForestFire::Param::Param ( const DataIO::Config cfg)
inline

Construct the parameters from the given configuration node.

101 :
102 p_growth(get_as<double>("p_growth", cfg)),
103 p_lightning(get_as<double>("p_lightning", cfg)),
104 p_immunity(get_as<double>("p_immunity", cfg))
105 {
106 if ((p_growth > 1.) or (p_growth < 0.)) {
107 throw std::invalid_argument("Invalid p_growth! Need be a value "
108 "in range [0, 1] and specify the probability per time step "
109 "and cell with which an empty cell turns into a tree.");
110 }
111 if ((p_lightning > 1.) or (p_lightning < 0.)) {
112 throw std::invalid_argument("Invalid p_lightning! Need be "
113 "in range [0, 1] and specify the probability per cell and "
114 "time step for lightning to strike.");
115 }
116 if ((p_immunity > 1.) or (p_immunity < 0.)) {
117 throw std::invalid_argument("Invalid p_immunity! "
118 "Need be a value in range [0, 1] and specify the probability "
119 "per neighbor with which that neighbor is immune to fire.");
120 }
121 }
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
const double p_lightning
Frequency of lightning occurring per cell.
Definition ForestFire.hh:94
const double p_growth
Rate of growth per cell.
Definition ForestFire.hh:91
const double p_immunity
The probability (per neighbor) to be immune to a spreading fire.
Definition ForestFire.hh:97

Member Data Documentation

◆ p_growth

const double Utopia::Models::ForestFire::Param::p_growth

Rate of growth per cell.

◆ p_immunity

const double Utopia::Models::ForestFire::Param::p_immunity

The probability (per neighbor) to be immune to a spreading fire.

◆ p_lightning

const double Utopia::Models::ForestFire::Param::p_lightning

Frequency of lightning occurring per cell.


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