1#ifndef UTOPIA_MODELS_ENVIRONMENT_ENVPARAMFUNCCOLLECTION_HH
2#define UTOPIA_MODELS_ENVIRONMENT_ENVPARAMFUNCCOLLECTION_HH
9namespace ParameterFunctionCollection {
22 class EnvParamFunc =
typename EnvModel::EnvParamFunc>
26 const std::string& param_name,
35 [&
model, param_name, mode,
dist{std::move(
dist)}] ()
mutable {
72 class EnvParamFunc =
typename EnvModel::EnvParamFunc>
77 EnvParamFunc
epf = [&
model, param_name, value] ()
mutable
79 return model.get_parameter(param_name) + value;
105 class EnvParamFunc =
typename EnvModel::EnvParamFunc>
124 std::poisson_distribution<>
dist(
mean);
151 throw std::invalid_argument(
"No method implemented to resolve "
152 "noise distribution '" +
distribution +
"'! Valid options: "
153 "normal, poisson, uniform_int, uniform_real.");
180 class EnvParamFunc =
typename EnvModel::EnvParamFunc>
183 using Time =
typename EnvModel::Time;
193 throw std::invalid_argument(
"The `time_in_max` argument cannot be "
194 "larger than the `period` argument in rectangular "
195 "environment parameter function!");
198 throw std::invalid_argument(
"The `phase` argument was not in interval "
235 class EnvParamFunc =
typename EnvModel::EnvParamFunc>
239 EnvParamFunc
epf = [value] ()
mutable
269 class EnvParamFunc =
typename EnvModel::EnvParamFunc>
272 using Time =
typename EnvModel::Time;
YAML::Node Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition types.hh:71
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
EnvParamFunc epf_sinusoidal(const EnvModel &model, const Config &cfg)
Creates a rule function for sinusoidal parameter values.
Definition env_param_func_collection.hh:270
EnvParamFunc epf_random(const EnvModel &model, const std::string ¶m_name, const Config &cfg)
Creates a rule function for random parameter values.
Definition env_param_func_collection.hh:106
EnvParamFunc epf_increment(const EnvModel &model, const std::string param_name, const Config &cfg)
Creates a rule function for incrementing parameter values.
Definition env_param_func_collection.hh:73
ValMode extract_val_mode(const DataIO::Config &cfg, const std::string &context)
Given a configuration node, extract the value mode.
Definition tools.hh:19
EnvParamFunc epf_rectangular(const EnvModel &model, const Config &cfg)
Creates a rule function for rectangular function like parameter values.
Definition env_param_func_collection.hh:181
EnvParamFunc epf_set(const EnvModel &, const Config &cfg)
Creates a rule function for setting a parameter value.
Definition env_param_func_collection.hh:236
ValMode
Value calculation mode.
Definition tools.hh:10
@ Add
Add the new value to the existing value.
EnvParamFunc build_rng_env_param_func(const EnvModel &model, DistType &&dist, const std::string ¶m_name, const ValMode &mode)
Create a rule function that uses a random number distribution.
Definition env_param_func_collection.hh:24
DataIO::Config Config
Configuration node type alias.
Definition env_param_func_collection.hh:13
Definition env_param_func_collection.hh:8
unsigned int DistType
Type for distancens, i.e. intermediately long unsigned integers.
Definition types.hh:37