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

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

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

Public Member Functions

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

Public Attributes

double some_global_parameter
 
double some_glob_parameter
 

Detailed Description

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

Note
This is used to allow standalone operation.

Constructor & Destructor Documentation

◆ EnvParam() [1/2]

EnvParam::EnvParam ( const Utopia::DataIO::Config cfg)
inline
15 :
16 some_global_parameter(Utopia::get_as<double>("some_global_parameter",
17 cfg, 0.))
18 { }
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_global_parameter
Definition Environment.cc:12

◆ ~EnvParam() [1/2]

EnvParam::~EnvParam ( )
default

◆ EnvParam() [2/2]

EnvParam::EnvParam ( const Utopia::DataIO::Config cfg)
inline
77 :
78 some_glob_parameter(Utopia::get_as<double>("some_glob_parameter",
79 cfg, 0.))
80 { }
double some_glob_parameter
Definition test.cc:74

◆ ~EnvParam() [2/2]

EnvParam::~EnvParam ( )
default

Member Function Documentation

◆ get_env() [1/2]

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

Getter.

Implements Utopia::Models::Environment::BaseEnvParam.

23 {
24 if (key == "some_global_parameter") {
26 }
27 throw std::invalid_argument("No access method for key '" + key
28 + "' in EnvParam!");
29 }

◆ get_env() [2/2]

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

Getter.

Implements Utopia::Models::Environment::BaseEnvParam.

85 {
86 if (key == "some_glob_parameter") {
88 }
89 throw std::invalid_argument("No access method for key '" + key
90 + "' in EnvParam!");
91 }

◆ set_env() [1/2]

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

Setter.

Implements Utopia::Models::Environment::BaseEnvParam.

34 {
35 if (key == "some_global_parameter") {
37 }
38 else {
39 throw std::invalid_argument("No setter method for key '" + key
40 + "' in EnvParam!");
41 }
42 }

◆ set_env() [2/2]

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

Setter.

Implements Utopia::Models::Environment::BaseEnvParam.

96 {
97 if (key == "some_glob_parameter") {
98 some_glob_parameter = value;
99 }
100 else {
101 throw std::invalid_argument("No setter method for key '" + key
102 + "' in EnvParam!");
103 }
104 }

Member Data Documentation

◆ some_glob_parameter

double EnvParam::some_glob_parameter

◆ some_global_parameter

double EnvParam::some_global_parameter

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