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::ContDisease::State Struct Reference

The full cell struct for the ContDisease model. More...

#include <state.hh>

Public Member Functions

template<class RNG >
 State (const DataIO::Config &cfg, const std::shared_ptr< RNG > &rng)
 Construct the cell state from a configuration and an RNG.
 

Public Attributes

Kind kind
 The cell state.
 
unsigned age
 The age of the cell.
 
unsigned int cluster_id
 An ID denoting to which cluster this cell belongs.
 

Detailed Description

The full cell struct for the ContDisease model.

Constructor & Destructor Documentation

◆ State()

template<class RNG >
Utopia::Models::ContDisease::State::State ( const DataIO::Config cfg,
const std::shared_ptr< RNG > &  rng 
)
inline

Construct the cell state from a configuration and an RNG.

36 :
38 age(0),
39 cluster_id(0)
40 {
41 // Check if p_tree is available to set up cell state
42 if (cfg["p_tree"]) {
43 const auto init_density = get_as<double>("p_tree", cfg);
44
45 // With this probability, the cell state is a tree
46 if (std::uniform_real_distribution<double>(0., 1.)(*rng)
47 < init_density)
48 {
50 }
51 }
52 }
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
@ tree
Cell represents a tree.
unsigned age
The age of the cell.
Definition state.hh:28
Kind kind
The cell state.
Definition state.hh:25
unsigned int cluster_id
An ID denoting to which cluster this cell belongs.
Definition state.hh:31

Member Data Documentation

◆ age

unsigned Utopia::Models::ContDisease::State::age

The age of the cell.

◆ cluster_id

unsigned int Utopia::Models::ContDisease::State::cluster_id

An ID denoting to which cluster this cell belongs.

◆ kind

Kind Utopia::Models::ContDisease::State::kind

The cell state.


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