Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Typedefs | Enumerations | Functions
Environment

The environment model provides a collection of parameter functions designed for coupling to other models. More...

Collaboration diagram for Environment:

Classes

struct  Utopia::Models::Environment::BaseEnvParam
 Base type for environment parameter. More...
 
struct  Utopia::Models::Environment::DummyEnvParam
 Dummy type for environment parameter. More...
 
struct  Utopia::Models::Environment::BaseEnvCellState
 Base type for environment cell states. More...
 
struct  Utopia::Models::Environment::DummyEnvCellState
 Dummy type for environment cell states. More...
 
class  Utopia::Models::Environment::Environment< EnvParam, EnvCellState, standalone >
 The Environment model provides a non-uniform, dynamic parameter background. More...
 
struct  Utopia::Models::Environment::FuncBundle::FuncBundle< Func, Time >
 A bundle wrapping a (iterative) function with metadata. More...
 
struct  Utopia::Models::Environment::FuncBundle::ParamFuncBundle< Func, Time >
 A bundle wrapping a (iterative) function with metadata. More...
 
struct  Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer >
 A bundle wrapping a (rule-)function with metadata. More...
 

Typedefs

using Utopia::Models::Environment::ModelTypes = Utopia::ModelTypes<>
 Type helper to define types used by the model. More...
 

Enumerations

enum class  Utopia::Models::Environment::ValMode { Utopia::Models::Environment::Set , Utopia::Models::Environment::Add }
 Value calculation mode. More...
 

Functions

template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_increment (const EnvModel &model, const std::string param_name, const Config &cfg)
 Creates a rule function for incrementing parameter values. More...
 
template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_random (const EnvModel &model, const std::string &param_name, const Config &cfg)
 Creates a rule function for random parameter values. More...
 
template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_rectangular (const EnvModel &model, const Config &cfg)
 Creates a rule function for rectangular function like parameter values. More...
 
template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_set (const EnvModel &, const Config &cfg)
 Creates a rule function for setting a parameter value. More...
 
template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_sinusoidal (const EnvModel &model, const Config &cfg)
 Creates a rule function for sinusoidal parameter values. More...
 
template<typename EnvModel , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair< EnvStateFunc, UpdateUtopia::Models::Environment::StateFunctionCollection::esf_noise (const EnvModel &model, const std::string &param_name, const Config &cfg)
 Creates a rule function for noisy parameter values. More...
 
template<typename EnvModel , typename Extent , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair< EnvStateFunc, UpdateUtopia::Models::Environment::StateFunctionCollection::esf_slope (const EnvModel &, const std::string &param_name, const Config &cfg, const Extent &extent)
 Creates a rule function for spatially linearly parameter values. More...
 
template<typename EnvModel , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair< EnvStateFunc, UpdateUtopia::Models::Environment::StateFunctionCollection::esf_steps (const EnvModel &, const std::string &param_name, const Config &cfg)
 Creates a rule function for spatial steps in the parameter values. More...
 
template<typename EnvModel , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair< EnvStateFunc, UpdateUtopia::Models::Environment::StateFunctionCollection::esf_uniform (const EnvModel &, const std::string &param_name, const Config &cfg)
 Creates a rule function for spatially uniform parameter values. More...
 
ValMode Utopia::Models::Environment::extract_val_mode (const DataIO::Config &cfg, const std::string &context)
 Given a configuration node, extract the value mode. More...
 
template<typename Time >
std::pair< bool, std::set< Time > > Utopia::Models::Environment::extract_times (const DataIO::Config &cfg)
 
template<typename Time >
std::tuple< bool, bool, std::set< Time > > Utopia::Models::Environment::extract_times_and_initialization (const DataIO::Config &cfg)
 
template<typename Time >
Time Utopia::Models::Environment::extract_time_start (const DataIO::Config &cfg)
 Given a configuration, extracts the time of first function invocation. More...
 

Detailed Description

The environment model provides a collection of parameter functions designed for coupling to other models.

For details on how this is to be used, consult the actual model documentation. The doxygen documentation here provides merely the API reference and information on the available parameters for each of the environment functions.

Typedef Documentation

◆ ModelTypes

Type helper to define types used by the model.

Enumeration Type Documentation

◆ ValMode

Value calculation mode.

Enumerator
Set 

Set a value, discarding the current state.

Add 

Add the new value to the existing value.

Function Documentation

◆ epf_increment()

template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_increment ( const EnvModel &  model,
const std::string  param_name,
const Config cfg 
)

Creates a rule function for incrementing parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • times: Sequence of time points at which to invoke this. if None, always incrementing
  • value: The incrementor
  • invoke_at_initialization: Whether to invoke at initialization. Default is False

◆ epf_random()

template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_random ( const EnvModel &  model,
const std::string &  param_name,
const Config cfg 
)

Creates a rule function for random parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • mode: set (default) or add
  • times: Sequence of time points at which to invoke this
  • distribution: The distribution type. For each value below, the corresponding additional parameters are required in cfg:
    • normal: mean and stddev
    • poisson: mean
    • exponential: lambda
    • uniform: interval (length 2 array)
    • uniform_int: interval (length 2 array)

◆ epf_rectangular()

template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_rectangular ( const EnvModel &  model,
const Config cfg 
)

Creates a rule function for rectangular function like parameter values.

Rectangular shaped parameters.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • times: Sequence of time points at which to invoke this. if None, always setting
  • offset: The minimum value. Optional, default 0.
  • amplitude: The amplitude above minimum value
  • period: The period
  • time_in_max: The number of steps in max value. Optional, default half period.
  • phase: The phase at first invocation in fraction of period length. E.g.: 0.5 for initialization at half period. Optional, default 0 equiv. in high value.

◆ epf_set()

template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_set ( const EnvModel &  ,
const Config cfg 
)

Creates a rule function for setting a parameter value.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • times: Sequence of time points at which to invoke this. if None, always setting
  • value: The new value
  • invoke_at_initialization: Whether to invoke at initialization. Default is False

◆ epf_sinusoidal()

template<typename EnvModel , class EnvParamFunc = typename EnvModel::EnvParamFunc>
EnvParamFunc Utopia::Models::Environment::ParameterFunctionCollection::epf_sinusoidal ( const EnvModel &  model,
const Config cfg 
)

Creates a rule function for sinusoidal parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • times: Sequence of time points at which to invoke this. if None, always setting
  • period: The period of the sinus
  • amplitude: The amplitude
  • phase: The phase shift at the point of first invokation. In multiples of pi. 1 = pi or 180 degree shift. Optional, default 0.
  • offset: Offset of the mean value over the full period. Optional, default 0.
Note
Cannot be invoked at initialization.

◆ esf_noise()

template<typename EnvModel , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair<EnvStateFunc, Update> Utopia::Models::Environment::StateFunctionCollection::esf_noise ( const EnvModel &  model,
const std::string &  param_name,
const Config cfg 
)

Creates a rule function for noisy parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • mode: set (default) or add
  • times: Sequence of time points at which to invoke this
  • distribution: The distribution type. For each value below, the corresponding additional parameters are required in cfg:
    • normal: mean and stddev
    • poisson: mean
    • exponential: lambda
    • uniform: interval (length 2 array)
    • uniform_int: interval (length 2 array)

◆ esf_slope()

template<typename EnvModel , typename Extent , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair<EnvStateFunc, Update> Utopia::Models::Environment::StateFunctionCollection::esf_slope ( const EnvModel &  ,
const std::string &  param_name,
const Config cfg,
const Extent &  extent 
)

Creates a rule function for spatially linearly parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • mode: set (default) or add
  • times: Sequence of time points
  • values_north_south: Values at northern and souther boundary; uses linear interpolation in between.
extentThe extent of space

◆ esf_steps()

template<typename EnvModel , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair<EnvStateFunc, Update> Utopia::Models::Environment::StateFunctionCollection::esf_steps ( const EnvModel &  ,
const std::string &  param_name,
const Config cfg 
)

Creates a rule function for spatial steps in the parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • mode: set (default) or add
  • times: Sequence of time points
  • values_north_south: Sequence of parameter values for the step heights, from north to south.
  • latitudes: Sequence of latitudes of separation, from north to south

◆ esf_uniform()

template<typename EnvModel , class EnvStateFunc = typename EnvModel::EnvStateFunc>
std::pair<EnvStateFunc, Update> Utopia::Models::Environment::StateFunctionCollection::esf_uniform ( const EnvModel &  ,
const std::string &  param_name,
const Config cfg 
)

Creates a rule function for spatially uniform parameter values.

Parameters
param_nameThe parameter to attach this environment function to
cfg

Configuration for this environment function. Allows the following arguments:

  • mode: set (default) or add
  • times: Sequence of time points
  • value: The scalar value to use

◆ extract_time_start()

template<typename Time >
Time Utopia::Models::Environment::extract_time_start ( const DataIO::Config cfg)

Given a configuration, extracts the time of first function invocation.

◆ extract_times()

template<typename Time >
std::pair<bool, std::set<Time> > Utopia::Models::Environment::extract_times ( const DataIO::Config cfg)

Given a configuration, extracts the set of times at which to invoke environment functions

◆ extract_times_and_initialization()

template<typename Time >
std::tuple<bool, bool, std::set<Time> > Utopia::Models::Environment::extract_times_and_initialization ( const DataIO::Config cfg)

Given a configuration, extracts the set of times at which to invoke environment functions and whether to invoke them at initialization

◆ extract_val_mode()

ValMode Utopia::Models::Environment::extract_val_mode ( const DataIO::Config cfg,
const std::string &  context 
)

Given a configuration node, extract the value mode.