Empirical
Public Member Functions | Protected Types | Protected Attributes | List of all members
emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... > Class Template Reference

#include <DataNode.h>

Inheritance diagram for emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >:
emp::DataNodeModule< VAL_TYPE, MODS... >

Public Member Functions

 DataNodeModule ()
 
VAL_TYPE GetHistMin () const
 
VAL_TYPE GetHistMax () const
 
size_t GetHistCount (size_t bin_id) const
 Return the count of items in the. More...
 
double GetHistWidth (size_t bin_id) const
 Return the width of the. More...
 
const emp::vector< size_t > & GetHistCounts () const
 Return a vector containing the count of items in each bin of the histogram. More...
 
emp::vector< double > GetBinMins () const
 Return a vector containing the lowest value allowed in each bin. More...
 
void SetupBins (VAL_TYPE _min, VAL_TYPE _max, size_t num_bins)
 
void AddDatum (const VAL_TYPE &val)
 Add. More...
 
void Reset ()
 Reset the DataNode (empties the historgram) More...
 
void PrintDebug (std::ostream &os=std::cout)
 Print debug information (useful for figuring out which modifiers you included) More...
 

Protected Types

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

Protected Attributes

VAL_TYPE offset
 Min value in first bin; others are offset by this much. More...
 
VAL_TYPE width
 How wide is the overall histogram? More...
 
IndexMap bins
 Map of values to which bin they fall in. More...
 
emp::vector< size_t > counts
 Counts in each bin. More...
 

Detailed Description

template<typename VAL_TYPE, emp::data... MODS>
class emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >

== data::Histogram == Make the DataNode track a histogram of values observed since the last reset.

Member Typedef Documentation

template<typename VAL_TYPE , emp::data... MODS>
using emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::base_t = DataNodeModule<VAL_TYPE>
protected
template<typename VAL_TYPE , emp::data... MODS>
using emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::parent_t = DataNodeModule<VAL_TYPE, MODS...>
protected
template<typename VAL_TYPE , emp::data... MODS>
using emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::this_t = DataNodeModule<VAL_TYPE, data::Histogram, MODS...>
protected

Constructor & Destructor Documentation

template<typename VAL_TYPE , emp::data... MODS>
emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::DataNodeModule ( )
inline

Member Function Documentation

template<typename VAL_TYPE , emp::data... MODS>
void emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::AddDatum ( const VAL_TYPE &  val)
inline

Add.

Parameters
valto the DataNode
template<typename VAL_TYPE , emp::data... MODS>
emp::vector<double> emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::GetBinMins ( ) const
inline

Return a vector containing the lowest value allowed in each bin.

template<typename VAL_TYPE , emp::data... MODS>
size_t emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::GetHistCount ( size_t  bin_id) const
inline

Return the count of items in the.

Parameters
bin_id'th bin of the histogram
template<typename VAL_TYPE , emp::data... MODS>
const emp::vector<size_t>& emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::GetHistCounts ( ) const
inline

Return a vector containing the count of items in each bin of the histogram.

template<typename VAL_TYPE , emp::data... MODS>
VAL_TYPE emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::GetHistMax ( ) const
inline

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

template<typename VAL_TYPE , emp::data... MODS>
VAL_TYPE emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::GetHistMin ( ) const
inline

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

template<typename VAL_TYPE , emp::data... MODS>
double emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::GetHistWidth ( size_t  bin_id) const
inline

Return the width of the.

Parameters
bin_id'th bin of the histogram
template<typename VAL_TYPE , emp::data... MODS>
void emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::PrintDebug ( std::ostream &  os = std::cout)
inline

Print debug information (useful for figuring out which modifiers you included)

template<typename VAL_TYPE , emp::data... MODS>
void emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::Reset ( )
inline

Reset the DataNode (empties the historgram)

template<typename VAL_TYPE , emp::data... MODS>
void emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::SetupBins ( VAL_TYPE  _min,
VAL_TYPE  _max,
size_t  num_bins 
)
inline

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 histogram
num_bins- The number of bins the histogram should have. The distance between min and max will be easily divided among this many bins.

Member Data Documentation

template<typename VAL_TYPE , emp::data... MODS>
IndexMap emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::bins
protected

Map of values to which bin they fall in.

template<typename VAL_TYPE , emp::data... MODS>
emp::vector<size_t> emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::counts
protected

Counts in each bin.

template<typename VAL_TYPE , emp::data... MODS>
VAL_TYPE emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::offset
protected

Min value in first bin; others are offset by this much.

template<typename VAL_TYPE , emp::data... MODS>
VAL_TYPE emp::DataNodeModule< VAL_TYPE, data::Histogram, MODS... >::width
protected

How wide is the overall histogram?


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