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

A non-abstract EnvCellState, derived from the base class. More...

Inheritance diagram for EnvCellState:
Inheritance graph
[legend]
Collaboration diagram for EnvCellState:
Collaboration graph
[legend]

Public Member Functions

 EnvCellState (const Utopia::DataIO::Config &cfg)
 
 ~EnvCellState ()=default
 
double get_env (const std::string &key) const override
 Getter.
 
void set_env (const std::string &key, const double &value) override
 Setter.
 
 EnvCellState (const Utopia::DataIO::Config &cfg)
 
 ~EnvCellState ()
 
double get_env (const std::string &key) const
 Getter.
 
void set_env (const std::string &key, const double &value)
 Setter.
 
- Public Member Functions inherited from Utopia::Models::Environment::BaseEnvCellState
virtual ~BaseEnvCellState ()=default
 

Public Attributes

double some_heterogeneous_parameter
 
double some_het_parameter
 
- Public Attributes inherited from Utopia::Models::Environment::BaseEnvCellState
SpaceVec position
 Cached barycenter of the cell.
 

Additional Inherited Members

- Public Types inherited from Utopia::Models::Environment::BaseEnvCellState
using SpaceVec = SpaceVecType< 2 >
 

Detailed Description

A non-abstract EnvCellState, derived from the base class.

Create a non-abstract EnvCellState.

Note
This is used to allow standalone operation.

Constructor & Destructor Documentation

◆ EnvCellState() [1/2]

EnvCellState::EnvCellState ( const Utopia::DataIO::Config cfg)
inline
54 :
56 Utopia::get_as<double>("some_heterogeneous_parameter", cfg, 0.))
57 { }
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
double some_heterogeneous_parameter
Definition Environment.cc:51

◆ ~EnvCellState() [1/2]

EnvCellState::~EnvCellState ( )
default

◆ EnvCellState() [2/2]

EnvCellState::EnvCellState ( const Utopia::DataIO::Config cfg)
inline
113 :
114 some_het_parameter(Utopia::get_as<double>("some_het_parameter",
115 cfg, 0.))
116 { }
double some_het_parameter
Definition test.cc:110

◆ ~EnvCellState() [2/2]

EnvCellState::~EnvCellState ( )
inline
118{ }

Member Function Documentation

◆ get_env() [1/2]

double EnvCellState::get_env ( const std::string &  key) const
inlinevirtual

Getter.

Implements Utopia::Models::Environment::BaseEnvCellState.

121 {
122 if (key == "some_het_parameter") {
123 return some_het_parameter;
124 }
125 throw std::invalid_argument("No access method to the key '"
126 + key + "' in EnvCellState!");
127 }

◆ get_env() [2/2]

double EnvCellState::get_env ( const std::string &  key) const
inlineoverridevirtual

Getter.

Implements Utopia::Models::Environment::BaseEnvCellState.

62 {
63 if (key == "some_heterogeneous_parameter") {
65 }
66 throw std::invalid_argument("No access method for key '" + key
67 + "' in EnvCellState!");
68 }

◆ set_env() [1/2]

void EnvCellState::set_env ( const std::string &  key,
const double value 
)
inlinevirtual

Setter.

Implements Utopia::Models::Environment::BaseEnvCellState.

130 {
131 if (key == "some_het_parameter") {
132 some_het_parameter = value;
133 return;
134 }
135 throw std::invalid_argument("No setter method to the key '"
136 + key + "' in EnvCellState!");
137 }

◆ set_env() [2/2]

void EnvCellState::set_env ( const std::string &  key,
const double value 
)
inlineoverridevirtual

Setter.

Implements Utopia::Models::Environment::BaseEnvCellState.

73 {
74 if (key == "some_heterogeneous_parameter") {
76 }
77 else {
78 throw std::invalid_argument("No setter method for key '" + key
79 + "' in EnvCellState!");
80 }
81 }

Member Data Documentation

◆ some_het_parameter

double EnvCellState::some_het_parameter

◆ some_heterogeneous_parameter

double EnvCellState::some_heterogeneous_parameter

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