OMNeT++ Simulation Library
6.0.3
|
#include <cprecolldensityest.h>
Base class for histogram-like density estimation classes.
DEPRECATED CLASS, do not use for new classes.
For the histogram classes, you need to specify the number of bins and the range. Range can either be set explicitly or you can choose automatic range determination.
Automatic range estimation works in the following way:
You may also explicitly specify the lower or upper limit and have the other end of the range estimated automatically. The setRange...() member functions of cPrecollectionBasedDensityEst deal with setting up the histogram range. It also provides pure virtual functions setUpBins() etc.
Subsequent observations are placed in the histogram structure. If an observation falls out of the histogram range, the underflow or overflow counter is incremented.
Public Types | |
enum | RangeMode |
Constants for histogram range_mode. More... | |
Public Member Functions | |
Constructors, destructor, assignment. | |
cPrecollectionBasedDensityEst (const cPrecollectionBasedDensityEst &other) | |
cPrecollectionBasedDensityEst (const char *name=nullptr, bool weighted=false) | |
virtual | ~cPrecollectionBasedDensityEst () |
cPrecollectionBasedDensityEst & | operator= (const cPrecollectionBasedDensityEst &res) |
Redefined cObject member functions. | |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) override |
Redefined cStatistic member functions. | |
virtual void | collect (double value) override |
virtual void | collectWeighted (double value, double weight) override |
virtual void | merge (const cStatistic *other) 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) |
Redefined methods | |
virtual bool | binsAlreadySetUp () const override |
virtual int64_t | getNumUnderflows () const override |
virtual int64_t | getNumOverflows () const override |
virtual double | getUnderflowSumWeights () const override |
virtual double | getOverflowSumWeights () const override |
virtual int64_t | getNumNegInfs () const override |
virtual int64_t | getNumPosInfs () const override |
virtual double | getNegInfSumWeights () const override |
virtual double | getPosInfSumWeights () const override |
Public Member Functions inherited from cAbstractHistogram | |
cAbstractHistogram (const cAbstractHistogram &other)=default | |
cAbstractHistogram (const char *name=nullptr, bool weighted=false) | |
virtual | ~cAbstractHistogram () |
cAbstractHistogram & | operator= (const cAbstractHistogram &res) |
virtual cAbstractHistogram * | dup () const override |
virtual void | setUpBins ()=0 |
virtual std::vector< double > | getBinEdges () const |
virtual std::vector< double > | getBinValues () const |
virtual int | getNumBins () const =0 |
virtual double | getBinEdge (int k) const =0 |
virtual double | getBinValue (int k) const =0 |
virtual double | getBinPDF (int k) const |
virtual Bin | getBinInfo (int k) const |
virtual double | getPDF (double x) const |
virtual double | getCDF (double x) const |
virtual double | draw () const override |
Public Member Functions inherited from cStdDev | |
cStdDev (const cStdDev &r) | |
cStdDev (const char *name=nullptr, bool weighted=false) | |
virtual | ~cStdDev () |
cStdDev & | operator= (const cStdDev &res) |
virtual std::string | str () const override |
virtual bool | isWeighted () const 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 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 |
Selecting the method of setting up the histogram range. | |
virtual void | setupRange () |
virtual void | collectIntoHistogram (double value)=0 |
virtual void | collectWeightedIntoHistogram (double value, double weight)=0 |
virtual void | setRange (double lower, double upper) |
virtual void | setRangeAuto (int numPrecollect=100, double rangeExtensionFactor=2.0) |
virtual void | setRangeAutoLower (double upper, int numPrecollect=100, double rangeExtensionFactor=2.0) |
virtual void | setRangeAutoUpper (double lower, int numPrecollect=100, double rangeExtensionFactor=2.0) |
virtual void | setNumPrecollectedValues (int numPrecollect) |
virtual int | getNumPrecollectedValues () const |
virtual double | getRangeExtensionFactor () 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) |
enum RangeMode |
Constants for histogram range_mode.
|
inline |
Copy constructor.
|
explicit |
Constructor.
|
virtual |
Destructor.
cPrecollectionBasedDensityEst& operator= | ( | const cPrecollectionBasedDensityEst & | res | ) |
Assignment operator. The name member is not copied; see cNamedObject::operator=() for details.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Collects one value. In the precollection phase, this method simply adds the value to the table of pre-collected values. When the number of pre-collected observations reaches a limit, the setUpBins() method is called. After transformation, it calls collectIntoHistogram() to update the stored statistics with this value.
Reimplemented from cStdDev.
|
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 cStdDev.
|
overridevirtual |
Updates this object with data coming from another statistics object – as if this object had collected observations fed into the other object as well. Throws an error if the other object is not a cPrecollectionBasedDensityEst.
Reimplemented from cStdDev.
Reimplemented in cKSplit.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Reads the object data from a file, in the format written out by saveToFile().
Reimplemented from cStdDev.
Reimplemented in cKSplit.
|
virtual |
Sets the histogram range explicitly to [lower, upper]. When this method is used, setNumPrecollectedValues() is not needed.
|
virtual |
Selects a histogram range setup method where the range will be determined entirely from a set of pre-collected values.
When called, the histogram range will be determined from the first numPrecollect values, extending their range symmetrically by rangeExtensionFactor. For example, after a call to setRangeAuto(100, 1.3), the histogram will be set up after pre-collecting 100 values, the range being the range of the 100 pre-collected values extended 1.3 times symmetrically.
|
virtual |
Selects a histogram range setup method where the upper bound of the range is fixed and the lower bound is determined from a set of pre-collected values.
The lower bound is calculated by extending the range (minimum of observations, upper) rangeExtensionFactor times.
|
virtual |
Selects a histogram range setup method where the lower bound of the range is fixed and the upper bound is determined from a set of pre-collected values.
The upper bound is calculated by extending the range (lower, maximum of observations) rangeExtensionFactor times.
|
virtual |
Sets the number of values to be pre-collected before transformation takes place. See setUpBins().
|
inlinevirtual |
Returns the number of values to be pre-collected before transformation takes place. See setUpBins().
|
inlinevirtual |
Returns the range extension factor, used with histogram range setup. See setRangeAuto() and setUpBins().
|
protectedvirtual |
Called internally by setUpBins(), this method should determine and set up the histogram range, based on the pre-collected data and the range setup method selected by calls to the setRange(), setRangeAuto(), setRangeAutoLower(), setRangeAutoUpper() methods.
|
protectedpure virtual |
|
protectedpure virtual |
|
inlineoverridevirtual |
Returns true if the histogram bins have already been set up. See setUpBins().
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns number of observations that were below the histogram range, independent of their weights.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns number of observations that were above the histogram range, independent of their weights.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns the total weight of the observations that were below the histogram range.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns the total weight of the observations that were above the histogram range.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns number of observations that were negative infinity, independent of their weights.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns number of observations that were positive infinity, independent of their weights.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns the total weight of the observations that were negative infinity.
Implements cAbstractHistogram.
|
inlineoverridevirtual |
Returns the total weight of the observations that were positive infinity.
Implements cAbstractHistogram.
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).