PhoenixSwarm  3.5.0
Library to ease communication between daemons
Loading...
Searching...
No Matches
StatAccumulator Class Reference

Accumulator of event occurence to build swarm statistics over a time period. More...

#include <Representation.h>

Public Member Functions

float & getHistLowerBound ()
 Gets the histLowerBound of the StatAccumulator.
 
float getHistLowerBound () const
 Gets the histLowerBound of the StatAccumulator.
 
float & getHistUpperBound ()
 Gets the histUpperBound of the StatAccumulator.
 
float getHistUpperBound () const
 Gets the histUpperBound of the StatAccumulator.
 
float & getMax ()
 Gets the max of the StatAccumulator.
 
float getMax () const
 Gets the max of the StatAccumulator.
 
float & getMin ()
 Gets the min of the StatAccumulator.
 
float getMin () const
 Gets the min of the StatAccumulator.
 
size_t & getNbEvent ()
 Gets the nbEvent of the StatAccumulator.
 
size_t getNbEvent () const
 Gets the nbEvent of the StatAccumulator.
 
size_t & getNbEventAboveUpperBound ()
 Gets the nbEventAboveUpperBound of the StatAccumulator.
 
size_t getNbEventAboveUpperBound () const
 Gets the nbEventAboveUpperBound of the StatAccumulator.
 
size_t & getNbEventBelowLowerBound ()
 Gets the nbEventBelowLowerBound of the StatAccumulator.
 
size_t getNbEventBelowLowerBound () const
 Gets the nbEventBelowLowerBound of the StatAccumulator.
 
float & getSum ()
 Gets the sum of the StatAccumulator.
 
float getSum () const
 Gets the sum of the StatAccumulator.
 
std::vector< size_t > & getVecHistogram ()
 Gets the vecHistogram of the StatAccumulator.
 
const std::vector< size_t > & getVecHistogram () const
 Gets the vecHistogram of the StatAccumulator.
 
StatAccumulatoroperator= (const StatAccumulator &other)
 Operator = of class StatAccumulator.
 
template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool readWriteStream (Stream &ds)
 Load the current StatAccumulator with a stream.
 
void setHistLowerBound (float histLowerBound)
 Sets the histLowerBound of the StatAccumulator.
 
void setHistUpperBound (float histUpperBound)
 Sets the histUpperBound of the StatAccumulator.
 
void setMax (float max)
 Sets the max of the StatAccumulator.
 
void setMin (float min)
 Sets the min of the StatAccumulator.
 
void setNbEvent (size_t nbEvent)
 Sets the nbEvent of the StatAccumulator.
 
void setNbEventAboveUpperBound (size_t nbEventAboveUpperBound)
 Sets the nbEventAboveUpperBound of the StatAccumulator.
 
void setNbEventBelowLowerBound (size_t nbEventBelowLowerBound)
 Sets the nbEventBelowLowerBound of the StatAccumulator.
 
void setSum (float sum)
 Sets the sum of the StatAccumulator.
 
void setVecHistogram (const std::vector< size_t > &vecHistogram)
 Sets the vecHistogram of the StatAccumulator.
 
 StatAccumulator ()
 Constructor of class StatAccumulator.
 
 StatAccumulator (const StatAccumulator &other)
 Copy Constructor of class StatAccumulator.
 
virtual ~StatAccumulator ()
 Destructor of class StatAccumulator.
 

Protected Member Functions

void copyStatAccumulator (const StatAccumulator &other)
 Copy Function of class StatAccumulator.
 

Private Member Functions

void initialisationStatAccumulator ()
 Initialisation Function of class StatAccumulator.
 

Private Attributes

float p_histLowerBound
 Minimum value in the histogram.
 
float p_histUpperBound
 Maximum value in the histogram.
 
float p_max
 Maximum value of the stat.
 
float p_min
 Minimum value of the stat.
 
size_t p_nbEvent
 Number of events used to make this statistic.
 
size_t p_nbEventAboveUpperBound
 Number of events above the upper boundary.
 
size_t p_nbEventBelowLowerBound
 Number of events below the lower bound.
 
float p_sum
 Sum of all values.
 
std::vector< size_t > p_vecHistogram
 Histogram to acccumulate event counts per quantile.
 

Detailed Description

Accumulator of event occurence to build swarm statistics over a time period.

Definition at line 434 of file Representation.h.

Constructor & Destructor Documentation

◆ StatAccumulator() [1/2]

StatAccumulator::StatAccumulator ( )

Constructor of class StatAccumulator.

Definition at line 979 of file Representation.cpp.

979 {
981}
void initialisationStatAccumulator()
Initialisation Function of class StatAccumulator.

References initialisationStatAccumulator().

Referenced by copyStatAccumulator(), operator=(), and StatAccumulator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~StatAccumulator()

StatAccumulator::~StatAccumulator ( )
virtual

Destructor of class StatAccumulator.

Definition at line 984 of file Representation.cpp.

984 {
985
986}

◆ StatAccumulator() [2/2]

StatAccumulator::StatAccumulator ( const StatAccumulator & other)

Copy Constructor of class StatAccumulator.

Parameters
other: StatAccumulator we want ot copy

Definition at line 991 of file Representation.cpp.

991 {
992 copyStatAccumulator(other);
993}
void copyStatAccumulator(const StatAccumulator &other)
Copy Function of class StatAccumulator.

References copyStatAccumulator(), and StatAccumulator().

+ Here is the call graph for this function:

Member Function Documentation

◆ copyStatAccumulator()

void StatAccumulator::copyStatAccumulator ( const StatAccumulator & other)
protected

Copy Function of class StatAccumulator.

Parameters
other: StatAccumulator we want ot copy

Definition at line 1196 of file Representation.cpp.

1196 {
1197 p_nbEvent = other.p_nbEvent;
1198 p_sum = other.p_sum;
1199 p_min = other.p_min;
1200 p_max = other.p_max;
1206}
float p_min
Minimum value of the stat.
size_t p_nbEventBelowLowerBound
Number of events below the lower bound.
float p_histLowerBound
Minimum value in the histogram.
float p_max
Maximum value of the stat.
float p_histUpperBound
Maximum value in the histogram.
size_t p_nbEventAboveUpperBound
Number of events above the upper boundary.
size_t p_nbEvent
Number of events used to make this statistic.
float p_sum
Sum of all values.
std::vector< size_t > p_vecHistogram
Histogram to acccumulate event counts per quantile.

References p_histLowerBound, p_histUpperBound, p_max, p_min, p_nbEvent, p_nbEventAboveUpperBound, p_nbEventBelowLowerBound, p_sum, p_vecHistogram, and StatAccumulator().

Referenced by operator=(), and StatAccumulator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHistLowerBound() [1/2]

float & StatAccumulator::getHistLowerBound ( )

Gets the histLowerBound of the StatAccumulator.

Returns
histLowerBound of the StatAccumulator

Definition at line 1147 of file Representation.cpp.

1147 {
1148 return p_histLowerBound;
1149}

References p_histLowerBound.

◆ getHistLowerBound() [2/2]

float StatAccumulator::getHistLowerBound ( ) const

Gets the histLowerBound of the StatAccumulator.

Returns
histLowerBound of the StatAccumulator

Definition at line 1140 of file Representation.cpp.

1140 {
1141 return p_histLowerBound;
1142}

References p_histLowerBound.

Referenced by CheckStream< StatAccumulator >::check_stream(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getHistUpperBound() [1/2]

float & StatAccumulator::getHistUpperBound ( )

Gets the histUpperBound of the StatAccumulator.

Returns
histUpperBound of the StatAccumulator

Definition at line 1161 of file Representation.cpp.

1161 {
1162 return p_histUpperBound;
1163}

References p_histUpperBound.

◆ getHistUpperBound() [2/2]

float StatAccumulator::getHistUpperBound ( ) const

Gets the histUpperBound of the StatAccumulator.

Returns
histUpperBound of the StatAccumulator

Definition at line 1154 of file Representation.cpp.

1154 {
1155 return p_histUpperBound;
1156}

References p_histUpperBound.

Referenced by CheckStream< StatAccumulator >::check_stream(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getMax() [1/2]

float & StatAccumulator::getMax ( )

Gets the max of the StatAccumulator.

Returns
max of the StatAccumulator

Definition at line 1119 of file Representation.cpp.

1119 {
1120 return p_max;
1121}

References p_max.

◆ getMax() [2/2]

float StatAccumulator::getMax ( ) const

Gets the max of the StatAccumulator.

Returns
max of the StatAccumulator

Definition at line 1112 of file Representation.cpp.

1112 {
1113 return p_max;
1114}

References p_max.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getMin() [1/2]

float & StatAccumulator::getMin ( )

Gets the min of the StatAccumulator.

Returns
min of the StatAccumulator

Definition at line 1105 of file Representation.cpp.

1105 {
1106 return p_min;
1107}

References p_min.

◆ getMin() [2/2]

float StatAccumulator::getMin ( ) const

Gets the min of the StatAccumulator.

Returns
min of the StatAccumulator

Definition at line 1098 of file Representation.cpp.

1098 {
1099 return p_min;
1100}

References p_min.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getNbEvent() [1/2]

size_t & StatAccumulator::getNbEvent ( )

Gets the nbEvent of the StatAccumulator.

Returns
nbEvent of the StatAccumulator

Definition at line 1077 of file Representation.cpp.

1077 {
1078 return p_nbEvent;
1079}

References p_nbEvent.

◆ getNbEvent() [2/2]

size_t StatAccumulator::getNbEvent ( ) const

Gets the nbEvent of the StatAccumulator.

Returns
nbEvent of the StatAccumulator

Definition at line 1070 of file Representation.cpp.

1070 {
1071 return p_nbEvent;
1072}

References p_nbEvent.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getNbEventAboveUpperBound() [1/2]

size_t & StatAccumulator::getNbEventAboveUpperBound ( )

Gets the nbEventAboveUpperBound of the StatAccumulator.

Returns
nbEventAboveUpperBound of the StatAccumulator

Definition at line 1189 of file Representation.cpp.

1189 {
1191}

References p_nbEventAboveUpperBound.

◆ getNbEventAboveUpperBound() [2/2]

size_t StatAccumulator::getNbEventAboveUpperBound ( ) const

Gets the nbEventAboveUpperBound of the StatAccumulator.

Returns
nbEventAboveUpperBound of the StatAccumulator

Definition at line 1182 of file Representation.cpp.

1182 {
1184}

References p_nbEventAboveUpperBound.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getNbEventBelowLowerBound() [1/2]

size_t & StatAccumulator::getNbEventBelowLowerBound ( )

Gets the nbEventBelowLowerBound of the StatAccumulator.

Returns
nbEventBelowLowerBound of the StatAccumulator

Definition at line 1175 of file Representation.cpp.

1175 {
1177}

References p_nbEventBelowLowerBound.

◆ getNbEventBelowLowerBound() [2/2]

size_t StatAccumulator::getNbEventBelowLowerBound ( ) const

Gets the nbEventBelowLowerBound of the StatAccumulator.

Returns
nbEventBelowLowerBound of the StatAccumulator

Definition at line 1168 of file Representation.cpp.

1168 {
1170}

References p_nbEventBelowLowerBound.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getSum() [1/2]

float & StatAccumulator::getSum ( )

Gets the sum of the StatAccumulator.

Returns
sum of the StatAccumulator

Definition at line 1091 of file Representation.cpp.

1091 {
1092 return p_sum;
1093}

References p_sum.

◆ getSum() [2/2]

float StatAccumulator::getSum ( ) const

Gets the sum of the StatAccumulator.

Returns
sum of the StatAccumulator

Definition at line 1084 of file Representation.cpp.

1084 {
1085 return p_sum;
1086}

References p_sum.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ getVecHistogram() [1/2]

std::vector< size_t > & StatAccumulator::getVecHistogram ( )

Gets the vecHistogram of the StatAccumulator.

Returns
vecHistogram of the StatAccumulator

Definition at line 1133 of file Representation.cpp.

1133 {
1134 return p_vecHistogram;
1135}

References p_vecHistogram.

◆ getVecHistogram() [2/2]

const std::vector< size_t > & StatAccumulator::getVecHistogram ( ) const

Gets the vecHistogram of the StatAccumulator.

Returns
vecHistogram of the StatAccumulator

Definition at line 1126 of file Representation.cpp.

1126 {
1127 return p_vecHistogram;
1128}

References p_vecHistogram.

Referenced by CheckStream< StatAccumulator >::check_stream(), BaseDaemon::fillVecStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ initialisationStatAccumulator()

void StatAccumulator::initialisationStatAccumulator ( )
private

Initialisation Function of class StatAccumulator.

Definition at line 1209 of file Representation.cpp.

1209 {
1210 p_nbEvent = 0lu;
1211 p_sum = 0.0f;
1212 p_min = 0.0f;
1213 p_max = 0.0f;
1214 p_histLowerBound = 0.0f;
1215 p_histUpperBound = 0.0f;
1218}

References p_histLowerBound, p_histUpperBound, p_max, p_min, p_nbEvent, p_nbEventAboveUpperBound, p_nbEventBelowLowerBound, and p_sum.

Referenced by StatAccumulator().

+ Here is the caller graph for this function:

◆ operator=()

StatAccumulator & StatAccumulator::operator= ( const StatAccumulator & other)

Operator = of class StatAccumulator.

Parameters
other: StatAccumulator we want ot copy
Returns
copied class StatAccumulator

Definition at line 999 of file Representation.cpp.

999 {
1000 copyStatAccumulator(other);
1001 return *this;
1002}

References copyStatAccumulator(), and StatAccumulator().

+ Here is the call graph for this function:

◆ readWriteStream()

template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool StatAccumulator::readWriteStream ( Stream & ds)
inline

Load the current StatAccumulator with a stream.

Parameters
[out]ds: stream to be used
Returns
true on success, false otherwise

Definition at line 473 of file Representation.h.

473 {
474 bool b(true);
475 b &= DataStream<Stream, Mode, size_t >::data_stream(ds, p_nbEvent);
476 b &= DataStream<Stream, Mode, float >::data_stream(ds, p_sum);
477 b &= DataStream<Stream, Mode, float >::data_stream(ds, p_min);
478 b &= DataStream<Stream, Mode, float >::data_stream(ds, p_max);
479 b &= DataStream<Stream, Mode, std::vector<size_t> >::data_stream(ds, p_vecHistogram);
480 b &= DataStream<Stream, Mode, float >::data_stream(ds, p_histLowerBound);
481 b &= DataStream<Stream, Mode, float >::data_stream(ds, p_histUpperBound);
482 b &= DataStream<Stream, Mode, size_t >::data_stream(ds, p_nbEventBelowLowerBound);
483 b &= DataStream<Stream, Mode, size_t >::data_stream(ds, p_nbEventAboveUpperBound);
484 return b;
485 }

References p_histLowerBound, p_histUpperBound, p_max, p_min, p_nbEvent, p_nbEventAboveUpperBound, p_nbEventBelowLowerBound, p_sum, and p_vecHistogram.

Referenced by DataStream< Stream, Mode, StatAccumulator >::data_stream().

+ Here is the caller graph for this function:

◆ setHistLowerBound()

void StatAccumulator::setHistLowerBound ( float histLowerBound)

Sets the histLowerBound of the StatAccumulator.

Parameters
histLowerBound: histLowerBound of the StatAccumulator

Definition at line 1042 of file Representation.cpp.

1042 {
1043 p_histLowerBound = histLowerBound;
1044}

References p_histLowerBound.

Referenced by BaseDaemon::createNewStat().

+ Here is the caller graph for this function:

◆ setHistUpperBound()

void StatAccumulator::setHistUpperBound ( float histUpperBound)

Sets the histUpperBound of the StatAccumulator.

Parameters
histUpperBound: histUpperBound of the StatAccumulator

Definition at line 1049 of file Representation.cpp.

1049 {
1050 p_histUpperBound = histUpperBound;
1051}

References p_histUpperBound.

Referenced by BaseDaemon::createNewStat().

+ Here is the caller graph for this function:

◆ setMax()

void StatAccumulator::setMax ( float max)

Sets the max of the StatAccumulator.

Parameters
max: max of the StatAccumulator

Definition at line 1028 of file Representation.cpp.

1028 {
1029 p_max = max;
1030}

References p_max.

Referenced by BaseDaemon::createNewStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ setMin()

void StatAccumulator::setMin ( float min)

Sets the min of the StatAccumulator.

Parameters
min: min of the StatAccumulator

Definition at line 1021 of file Representation.cpp.

1021 {
1022 p_min = min;
1023}

References p_min.

Referenced by BaseDaemon::createNewStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ setNbEvent()

void StatAccumulator::setNbEvent ( size_t nbEvent)

Sets the nbEvent of the StatAccumulator.

Parameters
nbEvent: nbEvent of the StatAccumulator

Definition at line 1007 of file Representation.cpp.

1007 {
1008 p_nbEvent = nbEvent;
1009}

References p_nbEvent.

Referenced by BaseDaemon::createNewStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ setNbEventAboveUpperBound()

void StatAccumulator::setNbEventAboveUpperBound ( size_t nbEventAboveUpperBound)

Sets the nbEventAboveUpperBound of the StatAccumulator.

Parameters
nbEventAboveUpperBound: nbEventAboveUpperBound of the StatAccumulator

Definition at line 1063 of file Representation.cpp.

1063 {
1064 p_nbEventAboveUpperBound = nbEventAboveUpperBound;
1065}

References p_nbEventAboveUpperBound.

Referenced by BaseDaemon::createNewStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ setNbEventBelowLowerBound()

void StatAccumulator::setNbEventBelowLowerBound ( size_t nbEventBelowLowerBound)

Sets the nbEventBelowLowerBound of the StatAccumulator.

Parameters
nbEventBelowLowerBound: nbEventBelowLowerBound of the StatAccumulator

Definition at line 1056 of file Representation.cpp.

1056 {
1057 p_nbEventBelowLowerBound = nbEventBelowLowerBound;
1058}

References p_nbEventBelowLowerBound.

Referenced by BaseDaemon::createNewStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ setSum()

void StatAccumulator::setSum ( float sum)

Sets the sum of the StatAccumulator.

Parameters
sum: sum of the StatAccumulator

Definition at line 1014 of file Representation.cpp.

1014 {
1015 p_sum = sum;
1016}

References p_sum.

Referenced by BaseDaemon::createNewStat(), and BaseDaemon::updateStatAccumulator().

+ Here is the caller graph for this function:

◆ setVecHistogram()

void StatAccumulator::setVecHistogram ( const std::vector< size_t > & vecHistogram)

Sets the vecHistogram of the StatAccumulator.

Parameters
vecHistogram: vecHistogram of the StatAccumulator

Definition at line 1035 of file Representation.cpp.

1035 {
1036 p_vecHistogram = vecHistogram;
1037}

References p_vecHistogram.

Referenced by BaseDaemon::createNewStat().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_histLowerBound

float StatAccumulator::p_histLowerBound
private

◆ p_histUpperBound

float StatAccumulator::p_histUpperBound
private

◆ p_max

float StatAccumulator::p_max
private

Maximum value of the stat.

Definition at line 498 of file Representation.h.

Referenced by copyStatAccumulator(), getMax(), getMax(), initialisationStatAccumulator(), readWriteStream(), and setMax().

◆ p_min

float StatAccumulator::p_min
private

Minimum value of the stat.

Definition at line 496 of file Representation.h.

Referenced by copyStatAccumulator(), getMin(), getMin(), initialisationStatAccumulator(), readWriteStream(), and setMin().

◆ p_nbEvent

size_t StatAccumulator::p_nbEvent
private

Number of events used to make this statistic.

Definition at line 492 of file Representation.h.

Referenced by copyStatAccumulator(), getNbEvent(), getNbEvent(), initialisationStatAccumulator(), readWriteStream(), and setNbEvent().

◆ p_nbEventAboveUpperBound

size_t StatAccumulator::p_nbEventAboveUpperBound
private

◆ p_nbEventBelowLowerBound

size_t StatAccumulator::p_nbEventBelowLowerBound
private

◆ p_sum

float StatAccumulator::p_sum
private

Sum of all values.

Definition at line 494 of file Representation.h.

Referenced by copyStatAccumulator(), getSum(), getSum(), initialisationStatAccumulator(), readWriteStream(), and setSum().

◆ p_vecHistogram

std::vector<size_t> StatAccumulator::p_vecHistogram
private

Histogram to acccumulate event counts per quantile.

Definition at line 500 of file Representation.h.

Referenced by copyStatAccumulator(), getVecHistogram(), getVecHistogram(), readWriteStream(), and setVecHistogram().


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