creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Public Attributes | List of all members
creativity::data::datum Struct Reference

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.
 

Detailed Description

Struct for holding a simulation data value calculator.

Constructor & Destructor Documentation

§ datum()

creativity::data::datum::datum ( std::string &&  name,
decltype(calculate calc,
bool  pre = true,
bool  piracy = true,
bool  policy = true 
)
inline

Constructor.

Parameters
namethe 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.
calcthe callable object to store in calculate.
prespecifies whether this data field applies to pre-piracy periods (default true)
piracyspecifies whether this data field applies to piracy periods (default true)
policyspecifies whether this data field applies to policy periods (default true)

Member Data Documentation

§ calculate

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.


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