creativity
v1.3.0
Agent-based model of creativity and piracy
|
Struct for holding a simulation data value calculator. More...
#include <creativity/data/simdata.hpp>
Public Member Functions | |
datum ()=delete | |
Default constructor deleted. | |
datum (std::string &&name, decltype(calculate) calc, bool pre=true, bool piracy=true, bool policy=true) | |
Constructor. More... | |
Public Attributes | |
const std::string | name |
The name of this parameter (will be prefixed with pre_, new_, or post_) | |
const std::function< double(const state::Storage &, eris::eris_time_t, eris::eris_time_t)> | calculate |
Callable object called to calculate the value of the parameter. More... | |
struct { | |
bool pre | |
True if this field applies to pre-piracy periods. | |
bool piracy | |
True if this field applies to piracy periods. | |
bool policy | |
True if this field applies to policy periods. | |
} | applies_to |
If true, this statistic is included in the pre-piracy data. | |
Struct for holding a simulation data value calculator.
|
inline |
Constructor.
name | the parameter name, which will be prefixed with "pre_", "new_", or "post_" when included in the output data. "pre_" is for the pre-piracy period; "new_" is for the periods just after piracy is introduced; and "post_" is for the final simulation periods. |
calc | the callable object to store in calculate . |
pre | specifies whether this data field applies to pre-piracy periods (default true) |
piracy | specifies whether this data field applies to piracy periods (default true) |
policy | specifies whether this data field applies to policy periods (default true) |
const std::function<double(const state::Storage&, eris::eris_time_t, eris::eris_time_t)> creativity::data::datum::calculate |
Callable object called to calculate the value of the parameter.
The object receives the simulation storage object and time periods from
and to
: it should calculate the statistic for the period from from
to to
, inclusive.