1 #ifndef UTOPIA_MODELS_ENVIRONMENT_FUNCBUNDLE_HH
2 #define UTOPIA_MODELS_ENVIRONMENT_FUNCBUNDLE_HH
16 template<
typename Func,
typename Time>
26 std::set<Time>
times = {})
41 template<
typename Func,
typename Time>
48 std::set<Time>
times = {})
56 std::tuple<
bool,
bool, std::set<Time>> invoke_times_tuple)
59 std::get<0>(invoke_times_tuple),
60 std::get<1>(invoke_times_tuple),
61 std::get<2>(invoke_times_tuple))
70 template<
typename RuleFunc,
typename Time,
typename CellContainer>
100 std::pair<
bool, std::set<Time>> times_pair,
101 std::tuple<bool, CellContainer, DataIO::Config> select_tuple)
105 std::get<bool>(select_tuple),
YAML::Node Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition: types.hh:71
Update
Update modes when applying rules.
Definition: state.hh:20
@ sync
Synchronous update.
DataIO::Config Config
Configuration node type alias.
Definition: env_param_func_collection.hh:13
Definition: env_param_func_collection.hh:8
EntityContainer< CellType > CellContainer
Type of the variably sized container for cells.
Definition: types.hh:26
Definition: parallel.hh:235
A bundle wrapping a (iterative) function with metadata.
Definition: func_bundle.hh:17
std::set< Time > times
Whether to invoke in every timestep.
Definition: func_bundle.hh:22
bool invoke_always
Whether to invoke at initialization.
Definition: func_bundle.hh:21
FuncBundle(std::string name, Func func, bool invoke_at_initialization=true, bool invoke_always=true, std::set< Time > times={})
When to invoke.
Definition: func_bundle.hh:24
Func func
The name of the function.
Definition: func_bundle.hh:19
std::string name
Definition: func_bundle.hh:18
bool invoke_at_initialization
The function.
Definition: func_bundle.hh:20
A bundle wrapping a (iterative) function with metadata.
Definition: func_bundle.hh:42
std::string param_name
The name of the parameter to which to apply the function.
Definition: func_bundle.hh:44
ParamFuncBundle(std::string name, Func func, std::string param_name, std::tuple< bool, bool, std::set< Time >> invoke_times_tuple)
Definition: func_bundle.hh:55
ParamFuncBundle(std::string name, Func func, std::string param_name, bool invoke_at_initialization=true, bool invoke_always=true, std::set< Time > times={})
Definition: func_bundle.hh:46
A bundle wrapping a (rule-)function with metadata.
Definition: func_bundle.hh:71
Update update
The update mode of the RuleFunc.
Definition: func_bundle.hh:73
RuleFuncBundle(std::string name, RuleFunc func, Update update, bool invoke_at_initialization, std::pair< bool, std::set< Time >> times_pair, std::tuple< bool, CellContainer, DataIO::Config > select_tuple)
Definition: func_bundle.hh:98
DataIO::Config select_cfg
Config node that is passed to the select_cells of the cell manager.
Definition: func_bundle.hh:81
bool fix_selection
Whether the selection of cells is fixed.
Definition: func_bundle.hh:77
RuleFuncBundle(std::string name, RuleFunc func, Update update=Update::sync, bool invoke_at_initialization=true, bool invoke_always=true, std::set< Time > times={}, bool fix_selection=false, const CellContainer &cell_selection={}, const DataIO::Config &select_cfg={})
Definition: func_bundle.hh:83
CellContainer cell_selection
Cell container over which to apply the func, optional.
Definition: func_bundle.hh:79