OMNeT++ Simulation Library
6.0.3
|
#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 |
virtual void | collect (double value)=0 |
virtual void | collect (SimTime value) |
virtual void | collectWeighted (double value, double weight) |
virtual void | collectWeighted (SimTime value, double weight) |
virtual void | collectWeighted (double value, SimTime weight) |
virtual void | collectWeighted (SimTime value, SimTime weight) |
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) |
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 |
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)=default | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
virtual std::string | getClassAndFullName () const |
virtual std::string | getClassAndFullPath () const |
const cObject * | getThisPtr () const |
virtual std::ostream & | printOn (std::ostream &os) const |
virtual bool | isSoftOwner () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
virtual cClassDescriptor * | getDescriptor () const |
void | copyNotSupported () const |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cSoftOwner * | getOwningContext () |
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::operator=() for details.
Referenced by cAbstractHistogram::operator=().
|
inlineoverridevirtual |
Creates and returns an exact copy of this object. See cObject for more details.
Reimplemented from cObject.
Reimplemented in cKSplit, cHistogram, 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 cKSplit, cHistogram, cPrecollectionBasedDensityEst, and cPSquare.
|
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 cKSplit, cHistogram, cPrecollectionBasedDensityEst, and cPSquare.
|
inlineoverridevirtual |
Returns false if this object represents unweighted statistics, and true if weighted.
Implements cStatistic.
|
overridevirtual |
Collects one observation.
Implements cStatistic.
Reimplemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.
|
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.
|
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 cAbstractHistogram, and cPSquare.
|
overridevirtual |
Clears the results collected so far.
Implements cStatistic.
Reimplemented in cKSplit, cPSquare, cHistogram, and cPrecollectionBasedDensityEst.
|
overridevirtual |
Writes the contents of the object into a text file.
Implements cStatistic.
Reimplemented in cHistogram, cKSplit, cPSquare, and cPrecollectionBasedDensityEst.
|
overridevirtual |
Reads the object data from a file written out by saveToFile() (or written by hand)
Implements cStatistic.
Reimplemented in cHistogram, cKSplit, cPSquare, and cPrecollectionBasedDensityEst.
virtual void collect |
Collects one value.
|
inline |
Convenience method, delegates to collect(double).
virtual void collectWeighted |
Collects one value with a given weight.
|
inline |
Convenience method, delegates to collectWeighted(double, double).
|
inline |
Convenience method, delegates to collectWeighted(double, double).
|
inline |
Convenience method, delegates to collectWeighted(double, double).