PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
Swarm::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 435 of file Representation.h.

Constructor & Destructor Documentation

◆ StatAccumulator() [1/2]

StatAccumulator::StatAccumulator ( )

Constructor of class StatAccumulator.

Definition at line 981 of file Representation.cpp.

981 {
983}
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 986 of file Representation.cpp.

986 {
987
988}

◆ StatAccumulator() [2/2]

StatAccumulator::StatAccumulator ( const StatAccumulator & other)

Copy Constructor of class StatAccumulator.

Parameters
other: StatAccumulator we want ot copy

Definition at line 993 of file Representation.cpp.

993 {
994 copyStatAccumulator(other);
995}
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 1198 of file Representation.cpp.

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

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 1149 of file Representation.cpp.

1149 {
1150 return p_histLowerBound;
1151}

References p_histLowerBound.

◆ getHistLowerBound() [2/2]

float StatAccumulator::getHistLowerBound ( ) const

Gets the histLowerBound of the StatAccumulator.

Returns
histLowerBound of the StatAccumulator

Definition at line 1142 of file Representation.cpp.

1142 {
1143 return p_histLowerBound;
1144}

References p_histLowerBound.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), and Swarm::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 1163 of file Representation.cpp.

1163 {
1164 return p_histUpperBound;
1165}

References p_histUpperBound.

◆ getHistUpperBound() [2/2]

float StatAccumulator::getHistUpperBound ( ) const

Gets the histUpperBound of the StatAccumulator.

Returns
histUpperBound of the StatAccumulator

Definition at line 1156 of file Representation.cpp.

1156 {
1157 return p_histUpperBound;
1158}

References p_histUpperBound.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), and Swarm::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 1121 of file Representation.cpp.

1121 {
1122 return p_max;
1123}

References p_max.

◆ getMax() [2/2]

float StatAccumulator::getMax ( ) const

Gets the max of the StatAccumulator.

Returns
max of the StatAccumulator

Definition at line 1114 of file Representation.cpp.

1114 {
1115 return p_max;
1116}

References p_max.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), Swarm::BaseDaemon::fillVecStat(), testUpdateStatAccumulator(), and Swarm::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 1107 of file Representation.cpp.

1107 {
1108 return p_min;
1109}

References p_min.

◆ getMin() [2/2]

float StatAccumulator::getMin ( ) const

Gets the min of the StatAccumulator.

Returns
min of the StatAccumulator

Definition at line 1100 of file Representation.cpp.

1100 {
1101 return p_min;
1102}

References p_min.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), Swarm::BaseDaemon::fillVecStat(), testUpdateStatAccumulator(), and Swarm::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 1079 of file Representation.cpp.

1079 {
1080 return p_nbEvent;
1081}

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 1072 of file Representation.cpp.

1072 {
1073 return p_nbEvent;
1074}

References p_nbEvent.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), Swarm::BaseDaemon::fillVecStat(), testUpdateStatAccumulator(), and Swarm::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 1191 of file Representation.cpp.

1191 {
1193}

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 1184 of file Representation.cpp.

1184 {
1186}

References p_nbEventAboveUpperBound.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), Swarm::BaseDaemon::fillVecStat(), testUpdateStatAccumulator(), and Swarm::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 1177 of file Representation.cpp.

1177 {
1179}

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 1170 of file Representation.cpp.

1170 {
1172}

References p_nbEventBelowLowerBound.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), Swarm::BaseDaemon::fillVecStat(), testUpdateStatAccumulator(), and Swarm::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 1093 of file Representation.cpp.

1093 {
1094 return p_sum;
1095}

References p_sum.

◆ getSum() [2/2]

float StatAccumulator::getSum ( ) const

Gets the sum of the StatAccumulator.

Returns
sum of the StatAccumulator

Definition at line 1086 of file Representation.cpp.

1086 {
1087 return p_sum;
1088}

References p_sum.

Referenced by CheckStream< Swarm::StatAccumulator >::check_stream(), Swarm::BaseDaemon::fillVecStat(), testUpdateStatAccumulator(), and Swarm::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 1135 of file Representation.cpp.

1135 {
1136 return p_vecHistogram;
1137}

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 1128 of file Representation.cpp.

1128 {
1129 return p_vecHistogram;
1130}

References p_vecHistogram.

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

+ Here is the caller graph for this function:

◆ initialisationStatAccumulator()

void StatAccumulator::initialisationStatAccumulator ( )
private

Initialisation Function of class StatAccumulator.

Definition at line 1211 of file Representation.cpp.

1211 {
1212 p_nbEvent = 0lu;
1213 p_sum = 0.0f;
1214 p_min = 0.0f;
1215 p_max = 0.0f;
1216 p_histLowerBound = 0.0f;
1217 p_histUpperBound = 0.0f;
1220}

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 1001 of file Representation.cpp.

1001 {
1002 copyStatAccumulator(other);
1003 return *this;
1004}

References copyStatAccumulator(), and StatAccumulator().

+ Here is the call graph for this function:

◆ readWriteStream()

template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool Swarm::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 474 of file Representation.h.

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

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, Swarm::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 1044 of file Representation.cpp.

1044 {
1045 p_histLowerBound = histLowerBound;
1046}

References p_histLowerBound.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), testClearStatAccumulator(), and testUpdateStatAccumulator().

+ 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 1051 of file Representation.cpp.

1051 {
1052 p_histUpperBound = histUpperBound;
1053}

References p_histUpperBound.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), testClearStatAccumulator(), and testUpdateStatAccumulator().

+ 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 1030 of file Representation.cpp.

1030 {
1031 p_max = max;
1032}

References p_max.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), and Swarm::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 1023 of file Representation.cpp.

1023 {
1024 p_min = min;
1025}

References p_min.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), and Swarm::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 1009 of file Representation.cpp.

1009 {
1010 p_nbEvent = nbEvent;
1011}

References p_nbEvent.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), and Swarm::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 1065 of file Representation.cpp.

1065 {
1066 p_nbEventAboveUpperBound = nbEventAboveUpperBound;
1067}

References p_nbEventAboveUpperBound.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), and Swarm::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 1058 of file Representation.cpp.

1058 {
1059 p_nbEventBelowLowerBound = nbEventBelowLowerBound;
1060}

References p_nbEventBelowLowerBound.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), and Swarm::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 1016 of file Representation.cpp.

1016 {
1017 p_sum = sum;
1018}

References p_sum.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), and Swarm::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 1037 of file Representation.cpp.

1037 {
1038 p_vecHistogram = vecHistogram;
1039}

References p_vecHistogram.

Referenced by Swarm::BaseDaemon::createNewStat(), createTestStatAccumulator(), testClearStatAccumulator(), and testUpdateStatAccumulator().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_histLowerBound

float Swarm::StatAccumulator::p_histLowerBound
private

◆ p_histUpperBound

float Swarm::StatAccumulator::p_histUpperBound
private

◆ p_max

float Swarm::StatAccumulator::p_max
private

Maximum value of the stat.

Definition at line 499 of file Representation.h.

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

◆ p_min

float Swarm::StatAccumulator::p_min
private

Minimum value of the stat.

Definition at line 497 of file Representation.h.

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

◆ p_nbEvent

size_t Swarm::StatAccumulator::p_nbEvent
private

Number of events used to make this statistic.

Definition at line 493 of file Representation.h.

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

◆ p_nbEventAboveUpperBound

size_t Swarm::StatAccumulator::p_nbEventAboveUpperBound
private

◆ p_nbEventBelowLowerBound

size_t Swarm::StatAccumulator::p_nbEventBelowLowerBound
private

◆ p_sum

float Swarm::StatAccumulator::p_sum
private

Sum of all values.

Definition at line 495 of file Representation.h.

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

◆ p_vecHistogram

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

Histogram to acccumulate event counts per quantile.

Definition at line 501 of file Representation.h.

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


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