21 #ifndef BASIC_DATA_CALCULATORS_H
22 #define BASIC_DATA_CALCULATORS_H
37 template <
typename T = u
int32_t>
122 template <
typename T>
132 m_varianceCurr =
NaN;
138 template <
typename T>
142 template <
typename T>
150 template <
typename T>
158 m_squareTotal += i*i;
199 m_varianceCurr = m_sCurr;
204 m_meanPrev = m_meanCurr;
208 m_meanCurr = m_meanPrev + (i - m_meanPrev) / m_count;
209 m_sCurr = m_sPrev + (i - m_meanPrev) * (i - m_meanCurr);
210 m_varianceCurr = m_sCurr / (m_count - 1);
216 template <
typename T>
227 m_varianceCurr =
NaN;
234 template <
typename T>
250 template <
typename T = u
int32_t>
288 template <
typename T>
294 template <
typename T>
298 template <
typename T>
306 template <
typename T>
316 template <
typename T>
326 template <
typename T>
334 template <
typename T>
double getSum() const
Returns the sum.
Abstract class for calculating statistical data.
double getMax() const
Returns the maximum value.
T m_min
Minimum value of MinMaxAvgTotalCalculator.
double getMin() const
Returns the minimum value.
T GetCount() const
Returns the count of the CounterCalculator.
T m_total
Total value of MinMaxAvgTotalCalculator.
double getSqrSum() const
Returns the sum of squares.
virtual ~MinMaxAvgTotalCalculator()
double getVariance() const
Returns the current variance.
virtual void Output(DataOutputCallback &callback) const
Outputs the data based on the provided callback.
void Reset()
Reinitializes all variables of MinMaxAvgTotalCalculator.
virtual void DoDispose(void)
Destructor implementation.
MinMaxAvgTotalCalculator()
const double NaN
Stored representation of NaN.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
T m_count
Count value of CounterCalculator.
virtual void DoDispose(void)
Destructor implementation.
Template class MinMaxAvgTotalCalculator.
double m_meanPrev
Previous mean of MinMaxAvgTotalCalculator.
double m_meanCurr
Current mean of MinMaxAvgTotalCalculator.
Callback class for the DataOutput classes.
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
double getStddev() const
Returns the standard deviation.
double m_varianceCurr
Current variance of MinMaxAvgTotalCalculator.
double m_sPrev
Previous s of MinMaxAvgTotalCalculator.
Calculates data during a simulation.
T m_max
Maximum value of MinMaxAvgTotalCalculator.
void Update()
Increments count by 1.
double getMean() const
Returns the mean value.
virtual void Output(DataOutputCallback &callback) const
Outputs the data based on the provided callback.
virtual void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum)=0
Outputs the data from the specified StatisticalSummary.
Template class CounterCalculator.
virtual ~CounterCalculator()
virtual void OutputSingleton(std::string key, std::string variable, int val)=0
Associates the integer value with the variable name for a specific output format. ...
T m_squareTotal
Sum of squares value of MinMaxAvgTotalCalculator.
double m_sCurr
Current s of MinMaxAvgTotalCalculator.
long getCount() const
Returns the count.
virtual void DoDispose(void)
Destructor implementation.
uint32_t m_count
Count value of MinMaxAvgTotalCalculator.