Data Collection and Recording Tools¶
Empirical includes a variety of tools for gathering and recording data.
The core of these tools is the DataNode class. DataNodes are containers
that you can pass as much data as you like into. When DataNodes are
built, they can be given various modifiers (specified as template
arguments) which control how much information they will collect about
the data they are passed. For instance, the data::Current
modifier
gives the DataNode the power to remember the last value it was passed,
whereas the data::Stats
modifier keeps track of a variety of
statistics about the distribution of data that the node has been
passed. Except where otherwise noted, modifiers can be combined freely.
Some also have dependencies on simpler modifiers. On the whole,
DataNodes are designed to be as lightweight as possible while still
keeping track of the desired information.
DataNodes that accept the same type of data and have the same modifiers can be grouped together using a DataManager.
The DataInterface class provides a general interface for interacting with DataNodes of any type. This is useful in cases where you have a collection of different types of DataNodes and want to operate on them without casting.
The DataFile class provides an interface for recording data at regular intervals. This data can come from DataNodes, the return of a specified function, or the contents of a specified variable. DataFiles are useful for collecting data over the course of a computational experiment.
Data Tools API¶
DataNodes¶
DataNode objects track a specific type of data over the course of a run.
Collection: New data can be pushed or pulled. Add(VAL… v) pushes data to a node AddDatum(VAL v) pushes just one datum, but can be used as an action for a signal.
 Note
This file is part of Empirical, https://github.com/devosoft/Empirical
 Copyright
Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
 Date
20162018
Process: What should happen on Reset() ?
Trigger an action to process the prior update’s data stored.
Clear all data.
Send data to a stream (or stats automatically have a stream that, if nonnull data is sent to?)

template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Current, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Current == This module lets you track the current (i.e. most recently added) value
Public Functions

DataNodeModule
()

const VAL_TYPE &
GetCurrent
() const Return the current (most recently added) value.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Current, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Attributes

VAL_TYPE
cur_val
Most recent value passed to this node.


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Info, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Info == This module adds information such as a name, description, and keyword for this node.
Public Functions

DataNodeModule
()
Protected Types

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Log, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Log == This module lets you log all of the values that have been added since the last reset
Public Functions

DataNodeModule
()

double
GetMedian
() const Calculate the median of observed values.

double
GetPercentile
(const double pct) const Calculate a percentile of observed values.

void
Reset
() Reset this DataNode (clear the current log of data)
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Log, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Archive, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Archive == This module keeps track of historical values in addition to those added since the last reset. Every time Reset() is called, all values that have been added since the previous time Reset() are stored in a vector in the archive.
Public Functions

DataNodeModule
()

const auto &
GetArchive
() const Get all data ever added to this DataNode. Returns a vector of vectors; each vector contains all data from a single time point (interval between resets)

const emp::vector<VAL_TYPE> &
GetData
(size_t update) const Get a vector of all data that was added during the.
 Parameters
update
: ‘th interval between resets.

const emp::vector<VAL_TYPE> &
GetData
() const Get a vector of all data that has been added since the last reset.

size_t
GetResetCount
() const Get the number of time intervals recorded in this DataNode. Note that this is one more than the number of times it has been reset

void
Reset
() Reset this DataNode, starting a new grouping of values in the archive. Resetting is useful for tracking data from different time points, such as per update or generation.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Archive, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Range, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Range == This module allows this DataNode to store information (min, max, mean, count, and total) about the distribution of the values that have been added since the last call to Reset().
Public Functions

DataNodeModule
()

double
GetTotal
() const Get the sum of all values added to this DataNode since the last reset.

double
GetMean
() const Get the mean of all values added to this DataNode since the last reset.

double
GetMin
() const Get the min of all values added to this DataNode since the last reset.

double
GetMax
() const Get the max of all values added to this DataNode since the last reset.

void
Reset
() Reset DataNode, setting the running calculations of total, min, mean, and max to 0.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Range, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Attributes

double
total
Total of all data since last reset.

double
min
Smallest value passed in since last reset.

double
max
Largest value passed in since last reset.


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::FullRange, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::FullRange == This module makes the DataNode store a history of distributional information measured by data::Range between calls to Reset(). Series of historical values are stored in vectors (except mean, which is calculated from total and count).
Public Functions

DataNodeModule
()

double
GetTotal
() const Get the sum of all values added to this DataNode since the last reset.

double
GetMean
() const Get the mean of all values added to this DataNode since the last reset.

double
GetMin
() const Get the minimum of all values added to this DataNode since the last reset.

double
GetMax
() const Get the maximum of all values added to this DataNode since the last reset.

double
GetTotal
(size_t update) const Get the sum of all values added to this DataNode during the.
 Parameters
update
: specified.

double
GetMean
(size_t update) const Get the mean of all values added to this DataNode during the.
 Parameters
update
: specified.

double
GetMin
(size_t update) const Get the minimum of all values added to this DataNode during the.
 Parameters
update
: specified.

double
GetMax
(size_t update) const Get the maximum of all values added to this DataNode during the.
 Parameters
update
: specified.

size_t
GetResetCount
() const Get the number of time intervals recorded in this DataNode. Note that this is one more than the number of times it has been reset

void
Reset
() Store the current range statistics in the archive and reset for a new interval.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::FullRange, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Stats, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Stats == Note: These statistics are calculated with the assumption that the data this node has received is the entire population of measurements we’re interested in, not a sample.
Note 2: Kurtosis is calculated using Snedecor and Cochran (1967)’s formula. A perfect normal distribution has a kurtosis of 0.
Public Functions

DataNodeModule
()

double
GetVariance
() const Get the variance (squared deviation from the mean) of values added since the last reset.

double
GetStandardDeviation
() const Get the standard deviation of values added since the last reset.

double
GetSkew
() const Get the skewness of values added since the last reset. This measurement tells you about the shape of the distribution. For a unimodal distribution, negative skew means that the distribution has a longer/thicker tail to the left. Positive skew means that ths distribution has a longer/thicker tail to the right.

double
GetKurtosis
() const Get the kurtosis of the values added since the last reset. This is another measurement that describes the shape of the distribution. High kurtosis means that there is more data in the tails of the distribution (i.e. the tails are “heavier”), whereas low kurtosis means that there is less data in the tails. We use Snedecor and Cochran (1967)’s formula to calculate kurtosis. Under this formula, a normal distribution has kurtosis of 0.

void
Reset
() Reset this node (resets current stats to 0)
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Stats, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Attributes

double
M2
The second moment of the distribution.

double
M3
The third moment of the distribution.

double
M4
The fourth moment of the distribution.


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Histogram, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Histogram == Make the DataNode track a histogram of values observed since the last reset.
Public Functions

DataNodeModule
()

VAL_TYPE
GetHistMin
() const Returns the minimum value this histogram is capable of containing (i.e. the minimum value for the first bin)

VAL_TYPE
GetHistMax
() const Returns the maximum value this histogram is capable of containing (i.e. the maximum value for the last bin)

size_t
GetHistCount
(size_t bin_id) const Return the count of items in the.
 Parameters
bin_id
: ‘th bin of the histogram

double
GetHistWidth
(size_t bin_id) const Return the width of the.
 Parameters
bin_id
: ‘th bin of the histogram

const emp::vector<size_t> &
GetHistCounts
() const Return a vector containing the count of items in each bin of the histogram.

int
GetOverflow
() const Return the count of numbers added to this histogram that were above the upper bound on the histogram

int
GetUnderflow
() const Return the count of numbers added to this histogram that were belowed the allowed lower bound

emp::vector<double>
GetBinMins
() const Return a vector containing the lowest value allowed in each bin.

void
SetupBins
(VAL_TYPE _min, VAL_TYPE _max, size_t num_bins) Sets up the ranges of values that go in each bin of the histogram.
 Parameters
_min
:  the lowest value allowed in the histogram_max
:  the largest value allowed in the histogramnum_bins
:  The number of bins the histogram should have. The distance between min and max will be easily divided among this many bins.

void
Reset
() Reset the DataNode (empties the historgram)
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Histogram, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename
VAL_TYPE
, emp::data...MODS
>
classemp
::
DataNodeModule
<VAL_TYPE, data::Pull, MODS...> : public emp::DataNodeModule<VAL_TYPE, MODS...>  #include <DataNode.hpp>
== data::Pull == This module makes it possible to give the DataNode a function that it can call to calculate new values or sets of values that it will then track. These functions are called every time the PullData method is called on this node, and the values they return are measured as specified by the other modules in this node.
Public Functions

DataNodeModule
()
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Pull, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Functions

void
PullData_impl
()
Protected Attributes

emp::FunctionSet<VAL_TYPE()>
pull_funs
Functions to pull data.

emp::FunctionSet< emp::vector< VAL_TYPE >)> pull_set_funs
Functions to pull sets of data.


namespace
emp
If we are in emscripten, make sure to include the header.
Typedefs

using
DataMonitor
= DataNode<T, data::Current, data::Info, data::Range, data::Stats, MODS...> A node that stores data about the most recent value it received, as well as the distribution (min, max, count, total, and mean) of values it has received since the last reset. It also allows you to give it a name, description, and keyword.

using
DataLog
= DataNode<T, data::Current, data::Info, data::Log, MODS...> A node that stores data about the most recent value it received, as well as all values it has received since the last reset. It also allows you to give it a name, description, and keyword.

using
DataArchive
= DataNode<T, data::Info, data::Archive, data::FullRange, MODS...> A node that stores all data it receives in an archive (vector of vectors). The inner vectors are groups of data that were received between resets. This node also keeps a record of the min, max, count, and total of each vector, so you don’t have to recalculate it later. Additionally, it allows you to give it a name, description, and keyword.
Enums

enum
data
A set of modifiers are available do describe DataNode.
Values:

enumerator
Current
Track most recent value.

enumerator
Info
Include information (name, keyword, description) for each instance.

enumerator
Log
Track all values since last Reset()

enumerator
Archive
Track Log + ALL values over time (with purge options)

enumerator
Range
Track min, max, mean, total.

enumerator
FullRange
Track Range data over time.

enumerator
Histogram
Keep a full histogram.

enumerator
Stats
Track Range + variance, standard deviation, skew, kurtosis.

enumerator
Pull
Enable data collection on request.
Various signals are possible:

enumerator
SignalReset
Include a signal that triggers BEFORE Reset() to process data.

enumerator
SignalData
Include a signal when new data is added (as a group)

enumerator
SignalDatum
Include a signal when each datum is added.

enumerator
SignalRange
Include a signal for data in a range.

enumerator
SignalLimits
Include a signal for data OUTSIDE a range.

enumerator
UNKNOWN
Unknown modifier; will trigger error.

enumerator

template<emp::data
MOD
>
structDataModInfo
 #include <DataNode.hpp>
Extra info about data modules that we need to know before actually building this DataNode. (for now, just REQUISITES for each module.)
Public Types

using
reqs
= ModPack<>

using

template<> Archive >

template<> FullRange >

template<> Stats >

template<emp::data
CUR_MOD
, emp::data...MODS
>
structDataModuleRequisiteAdd
<CUR_MOD, MODS...> Public Types

using
next_type
= typename DataModuleRequisiteAdd<MODS...>::type

using
this_req
= typename DataModInfo<CUR_MOD>::reqs

using

template<>
structDataModuleRequisiteAdd
<> Public Types

using
type
= ValPack<>

using

template<typename
VAL_TYPE
, emp::data...MODS
>
classDataNode
: public emp::DataNode_Interface<VAL_TYPE, FormatDataMods<MODS...>::sorted> Public Functions

void
Add
()

template<typename ...
Ts
>
voidAdd
(const VAL_TYPE &val, const Ts&... extras) Methods to provide new data.

void
PullData
() Method to retrieve new data.

void
Reset
() Methods to reset data.

void
PrintCurrent
(std::ostream &os = std::cout) const Methods to Print the templated values that a DataNode can produce.
Private Types

using
parent_t
= DataNode_Interface<VAL_TYPE, typename FormatDataMods<MODS...>::sorted>

void

template<typename
VAL_TYPE
, typenameMOD_PACK
>
classDataNode_Interface

template<typename
VAL_TYPE
, int...IMODS
>
classDataNode_Interface
<VAL_TYPE, ValPack<IMODS...>> : public emp::DataNodeModule<VAL_TYPE, (emp::data)IMODS...>  #include <DataNode.hpp>
Outermost interface to all DataNode modules.
Private Types

using
parent_t
= DataNodeModule<VAL_TYPE, (emp::data)IMODS...>

using

template<typename
VAL_TYPE
, emp::data...MODS
>
classDataNodeModule
 #include <DataNode.hpp>
Generic form of DataNodeModule (should never be used; trigger error!)
Public Functions

DataNodeModule
()


template<typename
VAL_TYPE
>
classDataNodeModule
<VAL_TYPE>  #include <DataNode.hpp>
Base form of DataNodeModule (available in ALL data nodes.)
Public Types

using
value_t
= VAL_TYPE
Public Functions

DataNodeModule
()

size_t
GetCount
() const Return the number of values that have been added to this node since the last reset.

size_t
GetResetCount
() const If reset count not tracked, always return 0. If any modifier causes history to be saved, it will override this function and indicate how much history is stored.

double
GetTotal
() const

double
GetMean
() const

double
GetMin
() const

double
GetMax
() const

double
GetVariance
() const

double
GetStandardDeviation
() const

double
GetSkew
() const

double
GetKurtosis
() const

double
GetMedian
() const Calculate the median of observed values.

double
GetPercentile
(const double pct) const Calculate a percentile of observed values.

const std::string &
GetName
() const

const std::string &
GetDescription
() const

const std::string &
GetKeyword
() const

void
SetName
(const std::string&)

void
SetDescription
(const std::string&)

void
SetKeyword
(const std::string&)

void
AddDatum
(const VAL_TYPE &val)

void
Reset
()
Protected Functions

void
PullData_impl
()

using

template<typename VAL_TYPE, emp::data... MODS> Archive, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Archive == This module keeps track of historical values in addition to those added since the last reset. Every time Reset() is called, all values that have been added since the previous time Reset() are stored in a vector in the archive.
Public Functions

DataNodeModule
()

const auto &
GetArchive
() const Get all data ever added to this DataNode. Returns a vector of vectors; each vector contains all data from a single time point (interval between resets)

const emp::vector<VAL_TYPE> &
GetData
(size_t update) const Get a vector of all data that was added during the.
 Parameters
update
: ‘th interval between resets.

const emp::vector<VAL_TYPE> &
GetData
() const Get a vector of all data that has been added since the last reset.

size_t
GetResetCount
() const Get the number of time intervals recorded in this DataNode. Note that this is one more than the number of times it has been reset

void
Reset
() Reset this DataNode, starting a new grouping of values in the archive. Resetting is useful for tracking data from different time points, such as per update or generation.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Archive, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename VAL_TYPE, emp::data... MODS> Current, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Current == This module lets you track the current (i.e. most recently added) value
Public Functions

DataNodeModule
()

const VAL_TYPE &
GetCurrent
() const Return the current (most recently added) value.

void
AddDatum
(const VAL_TYPE &val) Add.
 Parameters
val
: to this DataNode
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Current, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Attributes

VAL_TYPE
cur_val
Most recent value passed to this node.


template<typename VAL_TYPE, emp::data... MODS> FullRange, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::FullRange == This module makes the DataNode store a history of distributional information measured by data::Range between calls to Reset(). Series of historical values are stored in vectors (except mean, which is calculated from total and count).
Public Functions

DataNodeModule
()

double
GetTotal
() const Get the sum of all values added to this DataNode since the last reset.

double
GetMean
() const Get the mean of all values added to this DataNode since the last reset.

double
GetMin
() const Get the minimum of all values added to this DataNode since the last reset.

double
GetMax
() const Get the maximum of all values added to this DataNode since the last reset.

double
GetTotal
(size_t update) const Get the sum of all values added to this DataNode during the.
 Parameters
update
: specified.

double
GetMean
(size_t update) const Get the mean of all values added to this DataNode during the.
 Parameters
update
: specified.

double
GetMin
(size_t update) const Get the minimum of all values added to this DataNode during the.
 Parameters
update
: specified.

double
GetMax
(size_t update) const Get the maximum of all values added to this DataNode during the.
 Parameters
update
: specified.

size_t
GetResetCount
() const Get the number of time intervals recorded in this DataNode. Note that this is one more than the number of times it has been reset

void
Reset
() Store the current range statistics in the archive and reset for a new interval.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::FullRange, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename VAL_TYPE, emp::data... MODS> Histogram, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Histogram == Make the DataNode track a histogram of values observed since the last reset.
Public Functions

DataNodeModule
()

VAL_TYPE
GetHistMin
() const Returns the minimum value this histogram is capable of containing (i.e. the minimum value for the first bin)

VAL_TYPE
GetHistMax
() const Returns the maximum value this histogram is capable of containing (i.e. the maximum value for the last bin)

size_t
GetHistCount
(size_t bin_id) const Return the count of items in the.
 Parameters
bin_id
: ‘th bin of the histogram

double
GetHistWidth
(size_t bin_id) const Return the width of the.
 Parameters
bin_id
: ‘th bin of the histogram

const emp::vector<size_t> &
GetHistCounts
() const Return a vector containing the count of items in each bin of the histogram.

int
GetOverflow
() const Return the count of numbers added to this histogram that were above the upper bound on the histogram

int
GetUnderflow
() const Return the count of numbers added to this histogram that were belowed the allowed lower bound

emp::vector<double>
GetBinMins
() const Return a vector containing the lowest value allowed in each bin.

void
SetupBins
(VAL_TYPE _min, VAL_TYPE _max, size_t num_bins) Sets up the ranges of values that go in each bin of the histogram.
 Parameters
_min
:  the lowest value allowed in the histogram_max
:  the largest value allowed in the histogramnum_bins
:  The number of bins the histogram should have. The distance between min and max will be easily divided among this many bins.

void
AddDatum
(const VAL_TYPE &val) Add.
 Parameters
val
: to the DataNode

void
Reset
() Reset the DataNode (empties the historgram)
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Histogram, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename VAL_TYPE, emp::data... MODS> Info, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Info == This module adds information such as a name, description, and keyword for this node.
Public Functions

DataNodeModule
()
Protected Types

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>


template<typename VAL_TYPE, emp::data... MODS> Log, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Log == This module lets you log all of the values that have been added since the last reset
Public Functions

DataNodeModule
()

double
GetMedian
() const Calculate the median of observed values.

double
GetPercentile
(const double pct) const Calculate a percentile of observed values.

void
AddDatum
(const VAL_TYPE &val) Add.
 Parameters
val
: to this DataNode

void
Reset
() Reset this DataNode (clear the current log of data)
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Log, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>


template<typename VAL_TYPE, emp::data... MODS> Pull, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Pull == This module makes it possible to give the DataNode a function that it can call to calculate new values or sets of values that it will then track. These functions are called every time the PullData method is called on this node, and the values they return are measured as specified by the other modules in this node.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Pull, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Functions

void
PullData_impl
()
Protected Attributes

emp::FunctionSet<VAL_TYPE()>
pull_funs
Functions to pull data.

emp::FunctionSet< emp::vector< VAL_TYPE >)> pull_set_funs
Functions to pull sets of data.

using

template<typename VAL_TYPE, emp::data... MODS> Range, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Range == This module allows this DataNode to store information (min, max, mean, count, and total) about the distribution of the values that have been added since the last call to Reset().
Public Functions

DataNodeModule
()

double
GetTotal
() const Get the sum of all values added to this DataNode since the last reset.

double
GetMean
() const Get the mean of all values added to this DataNode since the last reset.

double
GetMin
() const Get the min of all values added to this DataNode since the last reset.

double
GetMax
() const Get the max of all values added to this DataNode since the last reset.

void
AddDatum
(const VAL_TYPE &val) Add.
 Parameters
val
: to this DataNode

void
Reset
() Reset DataNode, setting the running calculations of total, min, mean, and max to 0.
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Range, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Attributes

double
total
Total of all data since last reset.

double
min
Smallest value passed in since last reset.

double
max
Largest value passed in since last reset.


template<typename VAL_TYPE, emp::data... MODS> Stats, MODS... > : public emp::DataNodeModule< VAL_TYPE, MODS... >
 #include <DataNode.hpp>
== data::Stats == Note: These statistics are calculated with the assumption that the data this node has received is the entire population of measurements we’re interested in, not a sample.
Note 2: Kurtosis is calculated using Snedecor and Cochran (1967)’s formula. A perfect normal distribution has a kurtosis of 0.
Public Functions

DataNodeModule
()

double
GetVariance
() const Get the variance (squared deviation from the mean) of values added since the last reset.

double
GetStandardDeviation
() const Get the standard deviation of values added since the last reset.

double
GetSkew
() const Get the skewness of values added since the last reset. This measurement tells you about the shape of the distribution. For a unimodal distribution, negative skew means that the distribution has a longer/thicker tail to the left. Positive skew means that ths distribution has a longer/thicker tail to the right.

double
GetKurtosis
() const Get the kurtosis of the values added since the last reset. This is another measurement that describes the shape of the distribution. High kurtosis means that there is more data in the tails of the distribution (i.e. the tails are “heavier”), whereas low kurtosis means that there is less data in the tails. We use Snedecor and Cochran (1967)’s formula to calculate kurtosis. Under this formula, a normal distribution has kurtosis of 0.

void
AddDatum
(const VAL_TYPE &val) Add.
 Parameters
val
: to this DataNode

void
Reset
() Reset this node (resets current stats to 0)
Protected Types

using
this_t
= DataNodeModule<VAL_TYPE, data::Stats, MODS...>

using
parent_t
= DataNodeModule<VAL_TYPE, MODS...>

using
base_t
= DataNodeModule<VAL_TYPE>
Protected Attributes

double
M2
The second moment of the distribution.

double
M3
The third moment of the distribution.

double
M4
The fourth moment of the distribution.


using
DataManagers¶
DataManager handles a set of DataNode objects with the same tracking settings.
 Note
This file is part of Empirical, https://github.com/devosoft/Empirical
 Copyright
Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
 Date
20172018

namespace
emp
If we are in emscripten, make sure to include the header.

template<typename
VAL_TYPE
, emp::data...MODS
>
classDataManager
 #include <DataManager.hpp>
DataManagers handle sets of DataNode objects that all have the same tracking settings.
Public Functions

DataManager
()

~DataManager
()

size_t
GetSize
() const  Return
the number of DataNodes in this DataManager

auto &
GetNodes
() const  Return
the std::map mapping node names (strings) to DataNodes

bool
HasNode
(const std::string &name)

node_t &
New
(const std::string &name) Creates and adds a new DataNode
 Parameters
name
: the name of the DataNode

void
Delete
(const std::string &name) Deletes the DataNode with the specified name. Throws an error if there is no node with that name in this manager.
 Parameters
name
: the name of the DataNode to delete

node_t &
Get
(const std::string &name)  Return
a reference to the node with the specified name Throws an error if there is no node with that name in this manager
 Parameters
name
: the name of the DataNode

template<typename ...
Ts
>
voidAddData
(const std::string &name, Ts... extra) Adds data to a node in the DataManager.
Example:
DataManager<int, data::Current, data::Range> my_data_manager; my_data_manager.Add("my_node_name"); my_data_manager.AddData("my_node_name", 1, 2, 3, 4, 5);
 Parameters
name
: the node to add the data to.extra
: All subsequent arguments are the data to add to that node, and should be of whatever type all of the nodes in this manger expect.

void
ResetAll
() Resets all nodes in this manager. For nodes without the data::Archive attribute, this clears all of their data except current. For nodes with the data::Archive attribute, this creates a new vector to start storing data, retaining the old one in the archive.


template<typename
DataInterfaces¶
DataInterface is a generic interface to a DataNode.
 Note
This file is part of Empirical, https://github.com/devosoft/Empirical
 Copyright
Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
 Date
20162018

namespace
emp
If we are in emscripten, make sure to include the header.
Functions

template<typename
VAL_TYPE
, emp::data...EXTRA
>
DataInterface *MakeDataInterface
()

class
DataInterface
 #include <DataInterface.hpp>
A generic interface to a DataNode (so that you don’t need to know the node’s exact type)
Subclassed by emp::DataInterface_Impl< VAL_TYPE, EXTRA >
Public Functions

~DataInterface
()

size_t
GetCount
() const = 0

size_t
GetResetCount
() const = 0

double
GetTotal
() const = 0

double
GetMean
() const = 0

double
GetMin
() const = 0

double
GetMax
() const = 0

double
GetVariance
() const = 0

double
GetStandardDeviation
() const = 0

double
GetSkew
() const = 0

double
GetKurtosis
() const = 0

void
PullData
() = 0

void
Reset
() = 0

void
GetName
() = 0

void
GetDescription
() = 0

void
GetKeyword
() = 0


template<typename
VAL_TYPE
, emp::data...EXTRA
>
classDataInterface_Impl
: public emp::DataInterface 
Public Functions

DataInterface_Impl
()

DataInterface_Impl
(node_t *n)

DataInterface_Impl
(const DataInterface_Impl&) = delete

DataInterface_Impl
(DataInterface_Impl&&) = delete

~DataInterface_Impl
()

DataInterface_Impl &
operator=
(const DataInterface_Impl&) = delete

DataInterface_Impl &
operator=
(DataInterface_Impl&&) = delete

size_t
GetCount
() const Returns the number values added to this node since the last reset.

size_t
GetResetCount
() const Returns the number of times this node has been reset.

double
GetTotal
() const Returns the sum of values added since the last reset. Requires that the data::Range or data::FullRange be added to the DataNode

double
GetMean
() const Returns the mean of the values added since the last reset. Requires that the data::Range or data::FullRange be added to the DataNode

double
GetMin
() const Returns the minimum of the values added since the last reset. Requires that the data::Range or data::FullRange be added to the DataNode

double
GetMax
() const Returns the maximum of the values added since the last reset. Requires that the data::Range or data::FullRange be added to the DataNode

double
GetVariance
() const Returns the variance of the values added since the last reset. Requires that the data::Stats or data::FullStats be added to the DataNode

double
GetStandardDeviation
() const Returns the standard deviation of the values added since the last reset. Requires that the data::Stats or data::FullStats be added to the DataNode

double
GetSkew
() const Returns the skewness of the values added since the last reset. Requires that the data::Stats or data::FullStats be added to the DataNode

double
GetKurtosis
() const Returns the kurtosis of the values added since the last reset. Requires that the data::Stats or data::FullStats be added to the DataNode

void
PullData
() Runs the Pull function for this DataNode and records the resulting values. Requires that the data::Pull module was added to this DataNode, and that a pull function was specified.

void
Reset
() Reset this node. The exact effects of this depend on the modules that this node has, but in general it prepares the node to receive a new set of data.

void
PrintDebug
(std::ostream &os = std::cout) Print debug information about this node to
 Parameters
os
: Useful for tracking which modifiers are included.

void
GetName
() Returns this node’s name. Requires that the data::Info module was added to this DataNode, and that a name was set.

void
GetDescription
() Returns this node’s description. Requires that the data::Info module was added to this DataNode, and that a description was set.

void
GetKeyword
() Returns this node’s keyword. Requires that the data::Info module was added to this DataNode, and that a keyword was set.


template<typename
DataFiles¶
DataFile objects use DataNode objects to dynamically fill out file contents.
 Note
This file is part of Empirical, https://github.com/devosoft/Empirical
 Copyright
Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
 Date
20162018

namespace
emp
If we are in emscripten, make sure to include the header.
Functions

template<typename
CONTAINER
>
ContainerDataFile<CONTAINER>MakeContainerDataFile
(std::function<CONTAINER(void)> fun, const std::string &filename, const std::string &b = "", const std::string &s = ",", const std::string &e = "\, ) Convenience function for building a container data file.
 Parameters
fun
: is the function to call to update the containerfilename
: is the name of the file to output tob
: character to print at the beggininning of each lines
: delimeter (i.e. what character to print between entries on each line)e
: character to print at the end of each line

template<typename
CONTAINER
>
classContainerDataFile
: public emp::DataFile  #include <DataFile.hpp>
Sometimes you may want a data file where a set of functions is run on every item in a container every time you write to the file. ContainerDataFiles do that.
Note: CONTAINER type can be a pointer to a container and the datafile will handle dereferencing it appropriately.
Public Functions

template<typename ...
ARGS
>ContainerDataFile
(ARGS&&... arguments)

~ContainerDataFile
()

void
SetUpdateContainerFun
(const fun_update_container_t fun) Tell this file what function to run to update the contents of the container that data is being calculated on.

void
PrintHeaderKeys
() override Print a header containing the name of each column.

void
PrintHeaderComment
(const std::string &cstart = "# ") override Print a header containing comments describing all of the columns.

const container_t
GetCurrentRows
() const

void
OutputLine
(const data_t d)

void
Update
() override Run all of the functions and print the results as a new line in the file.

void
Update
(size_t update) override Update the file with an additional set of lines.
Protected Types

using
raw_container_t
= typename remove_ptr_type<container_t>::type

using
data_t
= typename raw_container_t::value_type

using
fun_update_container_t
= std::function<container_t(void)>
Protected Attributes

fun_update_container_t
update_container_fun

container_t
current_rows

FunctionSet<container_fun_t>
container_funs

template<typename ...

class
DataFile
 #include <DataFile.hpp>
Keep track of everything associated with periodically printing data to a file. Maintain a set of functions for calculating the desired measurements at each point in time that they are required. It also handles the formating of the file.
Subclassed by emp::ContainerDataFile< logbuffer_t >, emp::ContainerDataFile< CONTAINER >
Public Functions

DataFile
(const std::string &in_filename, const std::string &b = "", const std::string &s = ",", const std::string &e = "\)

DataFile
(std::ostream &in_os, const std::string &b = "", const std::string &s = ",", const std::string &e = "\)

DataFile
(const DataFile&) = default

DataFile
(DataFile&&) = default

~DataFile
()

const std::string &
GetFilename
() const Get the filename used for this file.

const std::string &
GetLineBegin
() const Returns the string that is printed at the beginning of each line.

const std::string &
GetSpacer
() const Returns the string that is printed between elements on each line (i.e. the delimeter).

const std::string &
GetLineEnd
() const Returns the string that is printed at the end of each line.

void
SetTiming
(time_fun_t fun) Provide a timing function with a bool(size_t update) signature. The timing function is called with the update, and returns a bool to indicate if files should print this update.

void
SetTimingOnce
(size_t print_time) Setup this file to print only once, at the specified update. Note that this timing function can be replaced at any time, even after being triggered.

void
SetTimingRepeat
(size_t step) Setup this file to print every ‘step’ updates.

void
SetTimingRange
(size_t first, size_t step, size_t last) Setup this file to print only in a specified time range, and a given frequency (step).

void
SetLineBegin
(const std::string &_in) Print a string at the beginning of each line.
 Parameters
_in
: the string to print

void
SetSpacer
(const std::string &_in) Print a string between elements.
 Parameters
_in
: the string (i.e. the delimeter).

void
SetLineEnd
(const std::string &_in) Print a string at the end of each line.
 Parameters
_in
: the string to print

void
SetupLine
(const std::string &b, const std::string &s, const std::string &e) Set line begin, delimeter, and line end characters.
 Parameters
b
: linebegin character.s
: column delimetere
: line end character

void
PrintHeaderKeys
() Print a header containing the name of each column.

void
PrintHeaderComment
(const std::string &cstart = "# ") Print a header containing comments describing all of the columns.

void
Update
() Run all of the functions and print the results as a new line in the file.

void
Update
(size_t update) If Update is called with an update number, the full version of update is called only if the update value passes the timing function (that is, the timing function returns true).
 Parameters
update
: the current time step

void
AddPreFun
(pre_fun_t fun) Add a function to run before each time data is calculated. You can add as many functions as you want.
 Parameters
fun
: the function to add

size_t
Add
(const std::function<void(std::ostream&)> &fun, const std::string &key, const std::string &desc, ) Generic function for adding a column to the DataFile. In practice, you probably want to call one of the more specific ones.
 Parameters
fun
: function to call to get the value to printkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)

template<typename
T
>
size_tAddFun
(const std::function<T()> &funconst std::string &key = "", const std::string &desc = "", ) Add a function that returns a value to be printed to the file.
 Parameters
fun
: function to call to get the value to printkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)

template<typename
T
>
size_tAddVar
(const T &var, const std::string &key = "", const std::string &desc = "") Add a function that always prints the current value of
var
. Parameters
var
: variable to print value ofkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddCurrent
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the current value from the DataNode
node
. Requires thatnode
have thedata::Current
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddMean
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the mean value from the DataNode
node
. Requires thatnode
have thedata::Range
ordata::FullRange
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated? template <typename VAL_TYPE, emp::data… MODS>

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddMedian
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the median value from the DataNode
node
. Requires thatnode
have thedata::Range
ordata::FullRange
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddPercentile
(DataNode<VAL_TYPE, MODS...> &node, const double pct = 100.0, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the Percentile value from the DataNode
node
. Requires thatnode
have thedata::Range
ordata::FullRange
modifier. Parameters
node
: DataNode to get data frompct
: the percentile value to returnkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddTotal
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the total value from the DataNode
node
. Requires thatnode
have thedata::Range
ordata::FullRange
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddMin
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the minimum value from the DataNode
node
. Requires thatnode
have thedata::Range
ordata::FullRange
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddMax
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the maximum value from the DataNode
node
. Requires thatnode
have thedata::Range
ordata::FullRange
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddVariance
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the variance from the DataNode
node
Requires thatnode
have thedata::Stats
ordata::FullStats
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddStandardDeviation
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the standard deviation from the DataNode
node
Requires thatnode
have thedata::Stats
ordata::FullStats
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddSkew
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the skewness from the DataNode
node
Requires thatnode
have thedata::Stats
ordata::FullStats
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddKurtosis
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the kurtosis from the DataNode
node
Requires thatnode
have thedata::Stats
ordata::FullStats
modifier. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
voidAddStats
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add multiple functions that pull common stats measurements (mean, variance, min, and max) from the DataNode
node
. Requires thatnode
have thedata::Stats
ordata::FullStats
modifier.key
anddesc
will have the name of the stat appended to the beginning. Note: excludes standard deviation, because it is easily calculated from variance Note: Settingpull
and/orreset
to true only pulls on first statistic calculated and only resets on the last. Otherwise there would be a risk of data loss or at least massive replication of computational effort. Even still, think carefully before setting either of these to true when you’re drawing varied information from the same node. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
voidAddAllStats
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add multiple functions that pull all stats measurements (mean, variance, min, max, skew, and kurtosis) from the DataNode
node
Requires thatnode
have thedata::Stats
ordata::FullStats
modifier.key
anddesc
will have the name of the stat appended to the beginning. Note: excludes standard deviation, because it is easily calculated from variance Note: Settingpull
and/orreset
to true only pulls on first statistic calculated and only resets on the last. Otherwise there would be a risk of data loss or at least massive replication of computational effort. Even still, think carefully before setting either of these to true when you’re drawing varied information from the same node. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddHistBin
(DataNode<VAL_TYPE, MODS...> &node, size_t bin_id, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the count of the
bin_id
‘th bin of the histogram fromnode
. Requires thatnode
have thedata::Histogram
modifier and at leastbin_id
bins. Parameters
node
: DataNode to get data frombin_id
: id of bin to log data from (0indexed)key
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
voidAddAllHistBins
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a set of functions that always pull the count of each bin of the histogram from
node
. Requires thatnode
have thedata::Histogram
modifier. Note: Settingpull
and/orreset
to true only pulls on first statistic calculated and only resets on the last. Otherwise there would be a risk of data loss or at least massive replication of computational effort. Even still, think carefully before setting either of these to true when you’re drawing varied information from the same node. Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?

template<typename
VAL_TYPE
, emp::data...MODS
>
size_tAddInferiority
(DataNode<VAL_TYPE, MODS...> &node, const std::string &key = "", const std::string &desc = "", const bool &reset = false, const bool &pull = false) Add a function that always pulls the inferiority (mean divided by max) from the specified DataNode. Requires that node have the data::Range or data::FullRange modifier.
 Parameters
node
: DataNode to get data fromkey
: Keyword associated with this column (gets used as a column name for this data)desc
: Full description of this data (used byPrintHeaderComment
)reset
: If this parameter is set true, we will call Reset on that DataNode after pulling the current value from the nodepull
: Should the node pull data before this statistic is calculated?
Protected Types

using
fun_t
= void(std::ostream&)

using
time_fun_t
= std::function<bool(size_t)>

using
pre_fun_t
= std::function<void()>
Protected Attributes

std::string
filename
Name of the file that we are printing to (if one exists)

std::ostream *
os
Stream to print to.

FunctionSet<fun_t>
funs
Set of functions to call, one per column in the file.

FunctionSet<void()>
pre_funs
Set of functions to call before calculating data.

time_fun_t
timing_fun
Function to determine updates to print on (default: all)

std::string
line_begin
What should we print at the start of each line?

std::string
line_spacer
What should we print between entries?

std::string
line_end
What should we print at the end of each line?


template<typename