|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_CSTDDEV_H
17 #define __OMNETPP_CSTDDEV_H
20 #include "cstatistic.h"
37 double sumWeightedValues;
38 double sumSquaredWeights;
39 double sumWeightedSquaredValues;
42 void copy(
const cStdDev& other);
45 void assertUnweighted()
const;
59 explicit cStdDev(
const char *name=
nullptr,
bool weighted=
false);
85 virtual std::string str()
const override;
92 virtual void parsimPack(
cCommBuffer *buffer)
const override;
99 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
113 virtual void collect(
double value)
override;
121 virtual void collectWeighted(
double value,
double weight)
override;
127 virtual void merge(
const cStatistic *other)
override;
132 virtual int64_t
getCount()
const override {
return numValues;}
139 virtual double getSum()
const override {assertUnweighted();
return sumWeightedValues;}
146 virtual double getSqrSum()
const override {assertUnweighted();
return sumWeightedSquaredValues;}
152 virtual double getMin()
const override;
158 virtual double getMax()
const override;
164 virtual double getMean()
const override;
170 virtual double getStddev()
const override;
176 virtual double getVariance()
const override;
206 virtual double draw()
const override;
211 virtual void clear()
override;
216 virtual void saveToFile(FILE *)
const override;
222 virtual void loadFromFile(FILE *)
override;
virtual ~cStdDev()
Definition: cstddev.h:64
virtual double getSqrSum() const override
Definition: cstddev.h:146
virtual double getSumWeights() const override
Definition: cstddev.h:182
virtual void collectWeighted(double value, double weight)
virtual int64_t getCount() const override
Definition: cstddev.h:132
virtual bool isWeighted() const override
Definition: cstddev.h:108
virtual void collect(double value)=0
cStdDev(const cStdDev &r)
Definition: cstddev.h:54
virtual double getWeightedSum() const override
Definition: cstddev.h:188
virtual double getSqrSumWeights() const override
Definition: cstddev.h:194
virtual double getWeightedSqrSum() const override
Definition: cstddev.h:200
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34
Statistics class to collect min, max, mean, and standard deviation.
Definition: cstddev.h:29
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
virtual double getSum() const override
Definition: cstddev.h:139
virtual cStdDev * dup() const override
Definition: cstddev.h:79