Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone > Class Template Reference

The Environment model provides a non-uniform, dynamic parameter background. More...

#include <Environment.hh>

Inheritance diagram for Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >:
Inheritance graph
[legend]
Collaboration diagram for Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >:
Collaboration graph
[legend]

Classes

struct  DummyCellManager
 A dummy CellManager type that is used in standalone mode. More...
 

Public Types

using Self = Environment< EnvParam, EnvCellState, standalone >
 Type of this class. More...
 
using Base = Model< Self, ModelTypes >
 The type of the Model base class of this derived class. More...
 
using DataGroup = typename Base::DataGroup
 Data type of the group to write model data to, holding datasets. More...
 
using DataSet = typename Base::DataSet
 Data type for a dataset. More...
 
using CellTraits = Utopia::CellTraits< EnvCellState, Update::manual >
 Cell traits specialization using the state type. More...
 
using CellManager = Utopia::CellManager< CellTraits, Self >
 The type of the cell manager. More...
 
using EnvCellContainer = CellContainer< typename CellManager::Cell >
 The type of the EnvCellContainer. More...
 
using Time = typename Base::Time
 The type of the model time. More...
 
using EnvParamFunc = typename std::function< double()>
 The type of the environment parameter functions. More...
 
using EnvParamFuncBundle = FuncBundle::ParamFuncBundle< EnvParamFunc, Time >
 The type wrapping EnvParamFunc with metadata. More...
 
using EnvStateFunc = typename CellManager::RuleFunc
 The type of the environment state functions; basically a rule function. More...
 
using EnvStateFuncBundle = FuncBundle::RuleFuncBundle< EnvStateFunc, Time, EnvCellContainer >
 The type wrapping EnvStateFunc with metadata. More...
 
using Config = DataIO::Config
 Configuration node type alias. More...
 
- Public Types inherited from Utopia::Model< Environment< DummyEnvParam, DummyEnvCellState, false >, ModelTypes >
using Config = typename ModelTypes::Config
 Data type that holds the configuration. More...
 
using DataManager = DataIO::Default::DefaultDataManager< Environment< DummyEnvParam, DummyEnvCellState, false > >
 The data manager to use, specialized with the derived model. More...
 
using DataGroup = typename ModelTypes::DataGroup
 Data type that is used for storing datasets. More...
 
using DataSet = typename ModelTypes::DataSet
 Data type that is used for storing data. More...
 
using RNG = typename ModelTypes::RNG
 Data type of the shared RNG. More...
 
using Space = typename ModelTypes::Space
 Data type of the space this model resides in. More...
 
using Time = typename ModelTypes::Time
 Data type for the model time. More...
 
using Monitor = typename ModelTypes::Monitor
 Data type for the monitor. More...
 
using MonitorManager = typename ModelTypes::MonitorManager
 Data type for the monitor manager. More...
 
using Level = typename ModelTypes::Level
 Data type for the hierarchical level. More...
 

Public Member Functions

template<class ParentModel , class CellManager >
 Environment (const std::string &name, ParentModel &parent_model, CellManager &&associate_cm, const DataIO::Config &custom_cfg={})
 Construct the Environment model associated to a CellManager. More...
 
template<typename ParentModel >
 Environment (const std::string name, ParentModel &parent)
 Construct Environment without associated CellManager. More...
 
void perform_step ()
 Iterate a single step. More...
 
void monitor ()
 Monitor model information. More...
 
void write_data ()
 Write data. More...
 
double get_parameter (const std::string &param_name) const
 Return the current value of the parameter with param_name. More...
 
void set_parameter (const std::string &param_name, double value)
 Change the current value of the parameter with param_name. More...
 
const auto & cm () const
 Return a const reference to the cell manager. More...
 
template<class EPFB >
void add_env_param_func (EPFB &&epfb)
 Add a rule function at the end of the sequence of parameter functions. More...
 
void add_env_param_func (const std::string &name, const EnvParamFunc &epf, const std::string &param_name, std::tuple< bool, bool, std::set< Time >> times_tuple)
 Add a param function at the end of the sequence of env functions. More...
 
void add_env_param_func_from_cfg (const std::string &name, const EnvParamFunc &epf, const std::string &param_name, const Config &cfg={})
 Add a param function at the end of the sequence of env functions. More...
 
template<bool add_to_initial = false, class ESFB >
void add_env_state_func (ESFB &&esfb)
 Add a rule function at the end of the sequence of state functions. More...
 
template<bool add_to_initial = false>
void add_env_state_func (const std::string &name, const EnvStateFunc &esf, const Update &update=Update::sync, std::pair< bool, std::set< Time >> times_pair={true, {}}, Config select_cfg={})
 Add a rule function at the end of the sequence of environment functions. More...
 
template<bool add_to_initial = false>
void add_env_state_func_from_cfg (const std::string &name, const EnvStateFunc &esf, const Update &update=Update::sync, const Config &cfg={})
 Add a rule function at the end of the sequence of environment functions. More...
 
void track_parameter (const std::string &key)
 Mark a parameter as being tracked, i.e. store its data in write_data. More...
 
void track_parameters (const std::vector< std::string > &keys)
 Track multiple parameters. More...
 
void track_state (const std::string &key)
 Mark a state as being tracked, i.e. store its data in write_data. More...
 
void track_states (const std::vector< std::string > &keys)
 Track multiple states. More...
 
- Public Member Functions inherited from Utopia::Model< Environment< DummyEnvParam, DummyEnvCellState, false >, ModelTypes >
 Model (const std::string &name, const ParentModel &parent_model, const Config &custom_cfg={}, std::tuple< WriterArgs... > w_args={}, const DataIO::Default::DefaultDecidermap< Environment< DummyEnvParam, DummyEnvCellState, false > > &w_deciders=DataIO::Default::default_deciders< Environment< DummyEnvParam, DummyEnvCellState, false > >, const DataIO::Default::DefaultTriggermap< Environment< DummyEnvParam, DummyEnvCellState, false > > &w_triggers=DataIO::Default::default_triggers< Environment< DummyEnvParam, DummyEnvCellState, false > >)
 Constructs a Model instance. More...
 
const std::shared_ptr< Space > & get_space () const
 Return the space this model resides in. More...
 
Time get_time () const
 Return the current time of this model. More...
 
Time get_time_max () const
 Return the maximum time possible for this model. More...
 
Config get_cfg () const
 Return the config node of this model. More...
 
std::string get_name () const
 Return the name of this model instance. More...
 
std::string get_full_name () const
 Return the full name of this model within the model hierarchy. More...
 
std::shared_ptr< DataGroupget_hdfgrp () const
 Return a pointer to the HDF group this model stores data in. More...
 
Time get_write_start () const
 Return the parameter that controls when write_data is called first. More...
 
Time get_write_every () const
 Return the parameter that controls how often write_data is called. More...
 
DataManager get_datamanager () const
 return the datamanager More...
 
hsize_t get_remaining_num_writes () const
 Return the number of remaining write_data calls this model will make. More...
 
std::shared_ptr< RNGget_rng () const
 Return a pointer to the shared RNG. More...
 
std::shared_ptr< spdlog::logger > get_logger () const
 Return a pointer to the logger of this model. More...
 
Monitor get_monitor () const
 Return the monitor of this model. More...
 
std::shared_ptr< MonitorManagerget_monitor_manager () const
 Get the monitor manager of the root model. More...
 
Level get_level () const
 Return the hierarchical level within the model hierarchy. More...
 
virtual void prolog ()
 A function that is called before starting model iteration. More...
 
virtual void epilog ()
 A function that is called after the last iteration of a model. More...
 
void iterate ()
 Iterate one (time) step of this model. More...
 
void run ()
 Run the model from the current time to the maximum time. More...
 
std::shared_ptr< DataSetcreate_dset (const std::string name, const std::shared_ptr< DataGroup > &hdfgrp, std::vector< hsize_t > add_write_shape, const std::size_t compression_level=1, const std::vector< hsize_t > chunksize={})
 Create a new dataset within the given group. More...
 
std::shared_ptr< DataSetcreate_dset (const std::string name, const std::vector< hsize_t > add_write_shape, const std::size_t compression_level=1, const std::vector< hsize_t > chunksize={})
 Create a new dataset within the model's base data group. More...
 
std::shared_ptr< DataSetcreate_cm_dset (const std::string name, const CellManager &cm, const std::size_t compression_level=1, const std::vector< hsize_t > chunksize={})
 Create a dataset storing data from a CellManager. More...
 
std::shared_ptr< DataSetcreate_am_dset (const std::string name, const AgentManager &am, const std::size_t compression_level=1, const std::vector< hsize_t > chunksize={})
 Create a dataset storing data from a AgentManager. More...
 

Private Member Functions

void setup_env_param_funcs (const Config &cfg)
 Construct the rule funcs sequencefor EnvParam from cfg. More...
 
template<bool add_to_initial = false>
void setup_env_state_funcs (const Config &cfg)
 Construct the rule funcs sequence from cfg. More...
 
template<class EPFB >
void apply_env_param_func (EPFB &&epfb, bool initialization=false)
 Apply a given environment parameter function. More...
 
template<class ESFB >
void apply_env_state_func (ESFB &&esfb)
 Apply a given environment state function. More...
 

Private Attributes

CellManager _cm
 The cell manager. More...
 
EnvParam _params
 The environment parameters. More...
 
std::vector< EnvParamFuncBundle_env_param_funcs
 Container of functions that are invoked every time step. More...
 
std::vector< EnvStateFuncBundle_init_env_state_funcs
 Container of rule functions that are invoked once at initialisation. More...
 
std::vector< EnvStateFuncBundle_env_state_funcs
 Container of rule functions that are invoked every time step. More...
 
std::unordered_map< std::string, std::shared_ptr< DataSet > > _dsets_state
 Dynamically generated map of datasets of cell states. More...
 
std::unordered_map< std::string, std::shared_ptr< DataSet > > _dsets_param
 Dynamically generated map of datasets of parameters. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Utopia::Model< Environment< DummyEnvParam, DummyEnvCellState, false >, ModelTypes >
void __perform_step ()
 Perform the computation of a step. More...
 
void __monitor ()
 Monitor information in the terminal. More...
 
void __write_data ()
 Write data; calls the implementation's write_data method. More...
 
void __write_initial_state ()
 Write the initial state. More...
 
void increment_time (const Time dt=1)
 Increment time. More...
 
void __prolog ()
 The default prolog of a model. More...
 
void __epilog ()
 The default epilog of a model. More...
 
Environment< DummyEnvParam, DummyEnvCellState, false > & impl ()
 cast to the derived class More...
 
const Environment< DummyEnvParam, DummyEnvCellState, false > & impl () const
 const cast to the derived interface More...
 
- Protected Attributes inherited from Utopia::Model< Environment< DummyEnvParam, DummyEnvCellState, false >, ModelTypes >
const std::string _name
 Name of the model instance. More...
 
const std::string _full_name
 The full name within the model hierarchy. More...
 
const Level _level
 The level within the model hierarchy. More...
 
const Config _cfg
 Config node belonging to this model instance. More...
 
const std::shared_ptr< RNG_rng
 The RNG shared between models. More...
 
const std::shared_ptr< spdlog::logger > _log
 The (model) logger. More...
 
std::shared_ptr< Space_space
 The space this model resides in. More...
 
Time _time
 Model-internal current time stamp. More...
 
const Time _time_max
 Model-internal maximum time stamp. More...
 
const std::shared_ptr< DataGroup_hdfgrp
 The HDF group this model instance should write its data to. More...
 
const Time _write_start
 First time at which write_data is called. More...
 
const Time _write_every
 How often to call write_data from iterate. More...
 
Monitor _monitor
 The monitor. More...
 
DataManager _datamanager
 Manager object for handling data output; see DataManager. More...
 
- Static Protected Attributes inherited from Utopia::Model< Environment< DummyEnvParam, DummyEnvCellState, false >, ModelTypes >
static constexpr WriteMode _write_mode
 Which data-writing mode the base model should use. More...
 

Detailed Description

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
class Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >

The Environment model provides a non-uniform, dynamic parameter background.

This happens by coupling to another model's CellManager. Additionally, global parameters can also be changed.

Template Parameters
EnvParamThe parameter type of the environment
EnvCellStateThe cell state type of the environment cells
standaloneWhether to have the model as a standalone model

Member Typedef Documentation

◆ Base

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::Base = Model<Self, ModelTypes>

The type of the Model base class of this derived class.

◆ CellManager

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::CellManager = Utopia::CellManager<CellTraits, Self>

The type of the cell manager.

◆ CellTraits

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::CellTraits = Utopia::CellTraits<EnvCellState, Update::manual>

Cell traits specialization using the state type.

◆ Config

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::Config = DataIO::Config

Configuration node type alias.

◆ DataGroup

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::DataGroup = typename Base::DataGroup

Data type of the group to write model data to, holding datasets.

◆ DataSet

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::DataSet = typename Base::DataSet

Data type for a dataset.

◆ EnvCellContainer

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::EnvCellContainer = CellContainer<typename CellManager::Cell>

The type of the EnvCellContainer.

◆ EnvParamFunc

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::EnvParamFunc = typename std::function<double()>

The type of the environment parameter functions.

◆ EnvParamFuncBundle

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::EnvParamFuncBundle = FuncBundle::ParamFuncBundle<EnvParamFunc, Time>

The type wrapping EnvParamFunc with metadata.

◆ EnvStateFunc

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::EnvStateFunc = typename CellManager::RuleFunc

The type of the environment state functions; basically a rule function.

◆ EnvStateFuncBundle

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::EnvStateFuncBundle = FuncBundle::RuleFuncBundle<EnvStateFunc, Time, EnvCellContainer>

The type wrapping EnvStateFunc with metadata.

◆ Self

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::Self = Environment<EnvParam, EnvCellState, standalone>

Type of this class.

◆ Time

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
using Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::Time = typename Base::Time

The type of the model time.

Constructor & Destructor Documentation

◆ Environment() [1/2]

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<class ParentModel , class CellManager >
Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::Environment ( const std::string &  name,
ParentModel &  parent_model,
CellManager &&  associate_cm,
const DataIO::Config custom_cfg = {} 
)
inline

Construct the Environment model associated to a CellManager.

Parameters
nameName of this model instance
parent_modelThe parent model this model instance resides in
associate_cmThe CellManager of the associate (i.e. parent) model. The Environment model's CellManager will use the configuration of that CellManager.
custom_cfgA custom configuration to use instead of the one extracted from the parent model using the instance name

◆ Environment() [2/2]

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<typename ParentModel >
Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::Environment ( const std::string  name,
ParentModel &  parent 
)
inline

Construct Environment without associated CellManager.

Note
This constructor can be used to set up a Environment as a standalone model or with only the EnvParam. In the case of standalone the standalone template parameter needs to be set to true. In the the other case the EnvCellState needs to be the default dummy type DummyEnvCellState and the standalone template parameter needs to be false (default).

Member Function Documentation

◆ add_env_param_func() [1/2]

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::add_env_param_func ( const std::string &  name,
const EnvParamFunc epf,
const std::string &  param_name,
std::tuple< bool, bool, std::set< Time >>  times_tuple 
)
inline

Add a param function at the end of the sequence of env functions.

Parameters
epfEnvParamFunc that is applied to all cm.cells()
times_tupleinvoke_at_initialization, invoke_always, set of times when to invoke the function

◆ add_env_param_func() [2/2]

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<class EPFB >
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::add_env_param_func ( EPFB &&  epfb)
inline

Add a rule function at the end of the sequence of parameter functions.

Parameters
epfbThe EnvParamFuncBundle of environment parameter function that is to be added and its metadata.

◆ add_env_param_func_from_cfg()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::add_env_param_func_from_cfg ( const std::string &  name,
const EnvParamFunc epf,
const std::string &  param_name,
const Config cfg = {} 
)
inline

Add a param function at the end of the sequence of env functions.

Parameters
epfEnvParamFunc that is applied to all cm.cells()
cfgFrom which invoke_at_initialization and times to invoke the function is extracted

◆ add_env_state_func() [1/2]

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<bool add_to_initial = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::add_env_state_func ( const std::string &  name,
const EnvStateFunc esf,
const Update update = Update::sync,
std::pair< bool, std::set< Time >>  times_pair = {true, {}},
Config  select_cfg = {} 
)
inline

Add a rule function at the end of the sequence of environment functions.

Parameters
esfEnvStateFunc that is applied to all cm.cells()
updateThe Update mode to use with apply_rule(esf, cm.cells)
times_pairinvoke_always, Set of times at which to invoke function.
select_cfgConfig passed to _cm.select_cells

◆ add_env_state_func() [2/2]

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<bool add_to_initial = false, class ESFB >
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::add_env_state_func ( ESFB &&  esfb)
inline

Add a rule function at the end of the sequence of state functions.

Parameters
esfbThe EnvStateFuncBundle of environment state function that is to be added and its metadata.

◆ add_env_state_func_from_cfg()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<bool add_to_initial = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::add_env_state_func_from_cfg ( const std::string &  name,
const EnvStateFunc esf,
const Update update = Update::sync,
const Config cfg = {} 
)
inline

Add a rule function at the end of the sequence of environment functions.

Parameters
esfEnvStateFunc that is applied to all cm.cells()
updateThe Update mode to use with apply_rule(esf, cm.cells)
cfgThe config of the state_func. Here, times and select are extracted; All other entries ignored. Defaults are invoke always and select all cells.

◆ apply_env_param_func()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<class EPFB >
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::apply_env_param_func ( EPFB &&  epfb,
bool  initialization = false 
)
inlineprivate

Apply a given environment parameter function.

Parameters
esfEnvParamFunc that is applied

◆ apply_env_state_func()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<class ESFB >
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::apply_env_state_func ( ESFB &&  esfb)
inlineprivate

Apply a given environment state function.

Parameters
esfEnvStateFunc that is applied to _cm.cells()

◆ cm()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
const auto& Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::cm ( ) const
inline

Return a const reference to the cell manager.

◆ get_parameter()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
double Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::get_parameter ( const std::string &  param_name) const
inline

Return the current value of the parameter with param_name.

◆ monitor()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::monitor ( )
inline

Monitor model information.

◆ perform_step()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::perform_step ( )
inline

Iterate a single step.

◆ set_parameter()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::set_parameter ( const std::string &  param_name,
double  value 
)
inline

Change the current value of the parameter with param_name.

◆ setup_env_param_funcs()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::setup_env_param_funcs ( const Config cfg)
inlineprivate

Construct the rule funcs sequencefor EnvParam from cfg.

◆ setup_env_state_funcs()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
template<bool add_to_initial = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::setup_env_state_funcs ( const Config cfg)
inlineprivate

Construct the rule funcs sequence from cfg.

◆ track_parameter()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::track_parameter ( const std::string &  key)
inline

Mark a parameter as being tracked, i.e. store its data in write_data.

◆ track_parameters()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::track_parameters ( const std::vector< std::string > &  keys)
inline

Track multiple parameters.

Invokes ::track_state for each entry

◆ track_state()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::track_state ( const std::string &  key)
inline

Mark a state as being tracked, i.e. store its data in write_data.

◆ track_states()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::track_states ( const std::vector< std::string > &  keys)
inline

Track multiple states.

Invokes ::track_state for each entry

◆ write_data()

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
void Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::write_data ( )
inline

Write data.

For all parameters and states registered for writing, writes the values to the corresponding dataset.

Note
To register keys, use ::track_parameter and ::track_state method, respectively

Member Data Documentation

◆ _cm

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
CellManager Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_cm
private

The cell manager.

◆ _dsets_param

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
std::unordered_map<std::string, std::shared_ptr<DataSet> > Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_dsets_param
private

Dynamically generated map of datasets of parameters.

◆ _dsets_state

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
std::unordered_map<std::string, std::shared_ptr<DataSet> > Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_dsets_state
private

Dynamically generated map of datasets of cell states.

◆ _env_param_funcs

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
std::vector<EnvParamFuncBundle> Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_env_param_funcs
private

Container of functions that are invoked every time step.

Functions changing a parameter

◆ _env_state_funcs

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
std::vector<EnvStateFuncBundle> Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_env_state_funcs
private

Container of rule functions that are invoked every time step.

Functions changing a state

◆ _init_env_state_funcs

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
std::vector<EnvStateFuncBundle> Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_init_env_state_funcs
private

Container of rule functions that are invoked once at initialisation.

Functions changing a state

◆ _params

template<typename EnvParam = DummyEnvParam, typename EnvCellState = DummyEnvCellState, bool standalone = false>
EnvParam Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >::_params
private

The environment parameters.


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