OMNeT++ Simulation Library
5.6.1
|
#include <cstddev.h>
Statistics class to collect min, max, mean, and standard deviation.
Public Member Functions | |
Constructors, destructor, assignment. | |
cStdDev (const cStdDev &r) | |
cStdDev (const char *name=nullptr, bool weighted=false) | |
virtual | ~cStdDev () |
cStdDev & | operator= (const cStdDev &res) |
Redefined cObject member functions. | |
virtual cStdDev * | dup () const override |
virtual std::string | str () const override |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) override |
Redefined cStatistic functions. | |
virtual bool | isWeighted () const override |
virtual void | collect (double value) override |
virtual void | collectWeighted (double value, double weight) override |
virtual void | merge (const cStatistic *other) override |
virtual int64_t | getCount () const override |
virtual double | getSum () const override |
virtual double | getSqrSum () const override |
virtual double | getMin () const override |
virtual double | getMax () const override |
virtual double | getMean () const override |
virtual double | getStddev () const override |
virtual double | getVariance () const override |
virtual double | getSumWeights () const override |
virtual double | getWeightedSum () const override |
virtual double | getSqrSumWeights () const override |
virtual double | getWeightedSqrSum () const override |
virtual double | draw () const override |
virtual void | clear () override |
virtual void | saveToFile (FILE *) const override |
virtual void | loadFromFile (FILE *) override |
Public Member Functions inherited from cStatistic | |
cStatistic (const cStatistic &r) | |
cStatistic (const char *name=nullptr) | |
virtual | ~cStatistic () |
cStatistic & | operator= (const cStatistic &res) |
virtual void | collect (SimTime value) |
virtual void | collectWeighted (SimTime value, double weight) |
virtual void | collectWeighted (double value, SimTime weight) |
virtual void | collectWeighted (SimTime value, SimTime weight) |
virtual void | record () |
virtual void | recordWithUnit (const char *unit) |
virtual void | recordAs (const char *name, const char *unit=nullptr) |
virtual _OPPDEPRECATED double | getWeights () const final |
virtual _OPPDEPRECATED void | collect2 (double value, double weight) final |
virtual _OPPDEPRECATED void | collect2 (SimTime value, double weight) final |
virtual _OPPDEPRECATED void | collect2 (double value, SimTime weight) final |
virtual _OPPDEPRECATED void | collect2 (SimTime value, SimTime weight) final |
virtual _OPPDEPRECATED double | random () const final |
virtual _OPPDEPRECATED void | clearResult () final |
Public Member Functions inherited from cRandom | |
cRandom (cRNG *rng) | |
cRandom (const char *name=nullptr, cRNG *rng=nullptr) | |
virtual | ~cRandom () |
virtual void | setRNG (cRNG *rng) |
cRNG * | getRNG () const |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
virtual bool | isSoftOwner () const |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual void | setName (const char *s) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other) | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
const cObject * | getThisPtr () const |
virtual _OPPDEPRECATED std::string | info () const |
virtual _OPPDEPRECATED std::string | detailedInfo () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
void | copyNotSupported () const |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cDefaultList * | getDefaultOwner () |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
|
explicit |
Constructor.
|
inlinevirtual |
Destructor.
Assignment operator. The name member is not copied; see cNamedObject's operator=() for more details.
Referenced by cAbstractHistogram::operator=(), and cWeightedStdDev::operator=().
|
inlineoverridevirtual |
Creates and returns an exact copy of this object. See cObject for more details.
Reimplemented from cObject.
Reimplemented in cDoubleHistogram, cLongHistogram, cWeightedStdDev, cKSplit, cHistogram, cVarHistogram, cPSquare, and cAbstractHistogram.
|
overridevirtual |
|
overridevirtual |
Serializes the object into an MPI send buffer. Used by the simulation kernel for parallel execution. See cObject for more details.
Reimplemented from cStatistic.
Reimplemented in cLegacyHistogram, cKSplit, cHistogram, cPrecollectionBasedDensityEst, cVarHistogram, cPSquare, and cLegacyHistogramBase.
|
overridevirtual |
Deserializes the object from an MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details.
Reimplemented from cStatistic.
Reimplemented in cLegacyHistogram, cKSplit, cHistogram, cPrecollectionBasedDensityEst, cVarHistogram, cPSquare, and cLegacyHistogramBase.
|
inlineoverridevirtual |
Returns false if this object represents unweighted statistics, and true if weighted.
Implements cStatistic.
References cStatistic::collect(), and cStatistic::collectWeighted().
|
overridevirtual |
Collects one observation.
Implements cStatistic.
Reimplemented in cLongHistogram, cHistogram, cPrecollectionBasedDensityEst, and cPSquare.
Referenced by cHistogram::dup().
|
overridevirtual |
Collects one observation with a given weight. The weight must not be negative. (Zero-weight observations are allowed, but will not affect mean and stddev.)
Reimplemented from cStatistic.
Reimplemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.
Referenced by cHistogram::dup().
|
overridevirtual |
Merge another statistics object into this one.
Implements cStatistic.
Reimplemented in cKSplit, cHistogram, cPSquare, and cPrecollectionBasedDensityEst.
|
inlineoverridevirtual |
Returns the number of values collected, regardless of their weights.
Implements cStatistic.
|
inlineoverridevirtual |
Returns the sum of the observations. The sum is only collected if the object represents unweighted statistics, i.e. it is an error to call this function for weighted statistics.
Implements cStatistic.
|
inlineoverridevirtual |
Returns the sum of squares of the collected observations. This is only collected if the object represents unweighted statistics, i.e. it is an error to call this function for weighted statistics.
Implements cStatistic.
|
overridevirtual |
Returns the minimum of the collected observations, or NaN if none have been collected yet.
Implements cStatistic.
|
overridevirtual |
Returns the maximum of the collected observations, or NaN if none have been collected yet.
Implements cStatistic.
|
overridevirtual |
Returns the (weighted/unweighted) mean of the collected observations, or NaN if none have been collected yet.
Implements cStatistic.
|
overridevirtual |
Returns the estimated (weighted/unweighted) standard deviation of the observations, or NaN if less than two observations have been collected.
Implements cStatistic.
|
overridevirtual |
Returns the variance of the observations collected, or NaN if less than two observations have been collected.
Implements cStatistic.
|
inlineoverridevirtual |
Returns the sum of weights. (For unweighted statistics, all weights are taken to be 1.0.)
Implements cStatistic.
|
inlineoverridevirtual |
Returns the sum of weight*value products. (For unweighted statistics, all weights are taken to be 1.0.)
Implements cStatistic.
|
inlineoverridevirtual |
Returns the sum of squared weights. (For unweighted statistics, all weights are taken to be 1.0.)
Implements cStatistic.
|
inlineoverridevirtual |
Returns the sum of weight*value*value products. (For unweighted statistics, all weights are taken to be 1.0.)
Implements cStatistic.
|
overridevirtual |
Returns a number from a normal distribution with the current mean and standard deviation.
Implements cRandom.
Reimplemented in cLegacyHistogram, cPSquare, cAbstractHistogram, and cVarHistogram.
|
overridevirtual |
Clears the results collected so far.
Implements cStatistic.
Reimplemented in cKSplit, cPSquare, cHistogram, cPrecollectionBasedDensityEst, cVarHistogram, and cLegacyHistogramBase.
|
overridevirtual |
Writes the contents of the object into a text file.
Implements cStatistic.
Reimplemented in cLegacyHistogram, cKSplit, cPSquare, cHistogram, cPrecollectionBasedDensityEst, cVarHistogram, and cLegacyHistogramBase.
|
overridevirtual |
Reads the object data from a file written out by saveToFile() (or written by hand)
Implements cStatistic.
Reimplemented in cLegacyHistogram, cKSplit, cPSquare, cHistogram, cPrecollectionBasedDensityEst, cVarHistogram, and cLegacyHistogramBase.