Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer > Struct Template Reference

A bundle wrapping a (rule-)function with metadata. More...

#include <func_bundle.hh>

Inheritance diagram for Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer >:
Inheritance graph
[legend]
Collaboration diagram for Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer >:
Collaboration graph
[legend]

Public Member Functions

 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={})
 
 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)
 
- Public Member Functions inherited from Utopia::Models::Environment::FuncBundle::FuncBundle< RuleFunc, Time >
 FuncBundle (std::string name, RuleFunc func, bool invoke_at_initialization=true, bool invoke_always=true, std::set< Time > times={})
 When to invoke.
 

Public Attributes

Update update
 The update mode of the RuleFunc.
 
bool fix_selection
 Whether the selection of cells is fixed.
 
CellContainer cell_selection
 Cell container over which to apply the func, optional.
 
DataIO::Config select_cfg
 Config node that is passed to the select_cells of the cell manager.
 
- Public Attributes inherited from Utopia::Models::Environment::FuncBundle::FuncBundle< RuleFunc, Time >
std::string name
 
RuleFunc func
 The name of the function.
 
bool invoke_at_initialization
 The function.
 
bool invoke_always
 Whether to invoke at initialization.
 
std::set< Time > times
 Whether to invoke in every timestep.
 

Detailed Description

template<typename RuleFunc, typename Time, typename CellContainer>
struct Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer >

A bundle wrapping a (rule-)function with metadata.

This gathers a rule function alongside some metadata into a custom construct. It can (optional) carry its own cellcontainer or a Config how to select cells from the cell manager.

Constructor & Destructor Documentation

◆ RuleFuncBundle() [1/2]

template<typename RuleFunc , typename Time , typename CellContainer >
Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer >::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 = {} 
)
inline
85 {},
86 bool fix_selection = false,
87 const CellContainer& cell_selection = {},
88 const DataIO::Config& select_cfg = {})
89 :
96 { }
YAML::Node Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition types.hh:71
EntityContainer< CellType > CellContainer
Type of the variably sized container for cells.
Definition types.hh:26
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, RuleFunc func, bool invoke_at_initialization=true, bool invoke_always=true, std::set< Time > times={})
When to invoke.
Definition func_bundle.hh:24
RuleFunc func
The name of the function.
Definition func_bundle.hh:19
bool invoke_at_initialization
The function.
Definition func_bundle.hh:20
Update update
The update mode of the RuleFunc.
Definition func_bundle.hh:73
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
CellContainer cell_selection
Cell container over which to apply the func, optional.
Definition func_bundle.hh:79

◆ RuleFuncBundle() [2/2]

template<typename RuleFunc , typename Time , typename CellContainer >
Utopia::Models::Environment::FuncBundle::RuleFuncBundle< RuleFunc, Time, CellContainer >::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 
)
inline
102 :
105 std::get<bool>(select_tuple),
106 std::get<CellContainer>(select_tuple),
107 std::get<DataIO::Config>(select_tuple))
108 {}
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213

Member Data Documentation

◆ cell_selection

Cell container over which to apply the func, optional.

◆ fix_selection

Whether the selection of cells is fixed.

◆ select_cfg

Config node that is passed to the select_cells of the cell manager.

◆ update

The update mode of the RuleFunc.


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