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

Cell State for the SandPile model. More...

#include <SandPile.hh>

Public Member Functions

 State ()=delete
 Default constructor.
 
template<typename RNG >
 State (const DataIO::Config &cfg, const std::shared_ptr< RNG > &rng)
 Configuration based constructor.
 

Public Attributes

Slope slope
 The current value of the slope.
 
bool in_avalanche
 Whether the cell was touched by an avalanche; useful for updating.
 

Detailed Description

Cell State for the SandPile model.

Constructor & Destructor Documentation

◆ State() [1/2]

Utopia::Models::SandPile::State::State ( )
delete

Default constructor.

◆ State() [2/2]

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

Configuration based constructor.

36 :
37 in_avalanche{false}
38 {
39 // Read in the initial slope range
40 const auto initial_slope_lower_limit =
41 get_as<Slope>("initial_slope_lower_limit", cfg);
42
43 const auto initial_slope_upper_limit =
44 get_as<Slope>("initial_slope_upper_limit", cfg);
45
46 // Make sure the parameters are valid
48 throw std::invalid_argument("The `inital_slope_*_limit` "
49 "parameters need to specify a valid range, i.e. with `lower` "
50 "being strictly smaller than the `upper`!");
51 }
52
53 // Depending on initial slope, set the initial slope of all cells to
54 // a random value in that interval
55 std::uniform_int_distribution<Slope>
57
58 // Set the initial slopes that are not relaxed, yet.
59 slope = dist(*rng);
60 }
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
Slope slope
The current value of the slope.
Definition SandPile.hh:25
bool in_avalanche
Whether the cell was touched by an avalanche; useful for updating.
Definition SandPile.hh:28

Member Data Documentation

◆ in_avalanche

bool Utopia::Models::SandPile::State::in_avalanche

Whether the cell was touched by an avalanche; useful for updating.

◆ slope

Slope Utopia::Models::SandPile::State::slope

The current value of the slope.


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