|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #ifndef BASIC_DATA_CALCULATORS_H
22 #define BASIC_DATA_CALCULATORS_H
26 #include "ns3/type-name.h"
38 template <
typename T = u
int32_t>
129 template <
typename T>
139 m_varianceCurr =
NaN;
145 template <
typename T>
150 template <
typename T>
159 template <
typename T>
163 static TypeId tid =
TypeId ( (
"ns3::MinMaxAvgTotalCalculator<"
167 .SetGroupName (
"Stats")
173 template <
typename T>
181 m_squareTotal += i*i;
190 m_min = (i < m_min) ? i : m_min;
191 m_max = (i > m_max) ? i : m_max;
216 m_varianceCurr = m_sCurr;
221 m_meanPrev = m_meanCurr;
225 m_meanCurr = m_meanPrev + (i - m_meanPrev) / m_count;
226 m_sCurr = m_sPrev + (i - m_meanPrev) * (i - m_meanCurr);
227 m_varianceCurr = m_sCurr / (m_count - 1);
233 template <
typename T>
244 m_varianceCurr =
NaN;
251 template <
typename T>
267 template <
typename T = u
int32_t>
311 template <
typename T>
317 template <
typename T>
322 template <
typename T>
330 .SetGroupName (
"Stats")
336 template <
typename T>
344 template <
typename T>
354 template <
typename T>
364 template <
typename T>
372 template <
typename T>
a unique identifier for an interface.
Abstract class for calculating statistical data.
double m_varianceCurr
Current variance of MinMaxAvgTotalCalculator.
virtual ~CounterCalculator()
Callback class for the DataOutput classes.
Calculates data during a simulation.
double m_sCurr
Current s of MinMaxAvgTotalCalculator.
T m_max
Maximum value of MinMaxAvgTotalCalculator.
virtual void DoDispose(void)
Destructor implementation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Update(const T i)
Increments count by i.
double getSum() const
Returns the sum.
double getMax() const
Returns the maximum value.
T m_min
Minimum value of MinMaxAvgTotalCalculator.
T GetCount() const
Returns the count of the CounterCalculator.
double m_sPrev
Previous s of MinMaxAvgTotalCalculator.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double m_meanCurr
Current mean of MinMaxAvgTotalCalculator.
static TypeId GetTypeId(void)
Register this type.
void Reset()
Reinitializes all variables of MinMaxAvgTotalCalculator.
double getMin() const
Returns the minimum value.
double getVariance() const
Returns the current variance.
double getSqrSum() const
Returns the sum of squares.
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.
A base class which provides memory management and object aggregation.
virtual void OutputStatistic(std::string key, std::string variable, const StatisticalSummary *statSum)=0
Outputs the data from the specified StatisticalSummary.
T m_total
Total value of MinMaxAvgTotalCalculator.
uint32_t m_count
Count value of MinMaxAvgTotalCalculator.
static TypeId GetTypeId(void)
Register this type.
Template class MinMaxAvgTotalCalculator.
T m_count
Count value of CounterCalculator.
double m_meanPrev
Previous mean of MinMaxAvgTotalCalculator.
Template class CounterCalculator.
virtual ~MinMaxAvgTotalCalculator()
void Update()
Increments count by 1.
long getCount() const
Returns the count.
const double NaN
Stored representation of NaN.
MinMaxAvgTotalCalculator()
virtual void Output(DataOutputCallback &callback) const
Outputs the data based on the provided callback.
double getMean() const
Returns the mean value.
T m_squareTotal
Sum of squares value of MinMaxAvgTotalCalculator.
virtual void Output(DataOutputCallback &callback) const
Outputs the data based on the provided callback.
virtual void DoDispose(void)
Destructor implementation.
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
double getStddev() const
Returns the standard deviation.
virtual void DoDispose(void)
Destructor implementation.