OMNeT++ Simulation Library
5.6.1
|
#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 |
Selecting the method of setting up the histogram range. | |
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 |
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) | |
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 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 |
virtual _OPPDEPRECATED bool | isTransformed () const final |
virtual _OPPDEPRECATED void | transform () final |
virtual _OPPDEPRECATED int | getNumCells () const final |
virtual _OPPDEPRECATED double | getBasepoint (int k) const final |
virtual _OPPDEPRECATED double | getCellValue (int k) const final |
virtual _OPPDEPRECATED double | getCellPDF (int k) const final |
virtual _OPPDEPRECATED int64_t | getUnderflowCell () const final |
virtual _OPPDEPRECATED int64_t | getOverflowCell () const final |
virtual _OPPDEPRECATED Bin | getCellInfo (int k) const final |
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 |
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 |
Protected Member Functions | |
virtual void | setupRange () |
virtual void | collectIntoHistogram (double value)=0 |
virtual void | collectWeightedIntoHistogram (double value, double weight)=0 |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cDefaultList * | getDefaultOwner () |
enum RangeMode |
Constants for histogram range_mode.
|
inline |
Copy constructor.
References cStatistic::collect(), and cStatistic::collectWeighted().
|
explicit |
Constructor.
|
virtual |
Destructor.
cPrecollectionBasedDensityEst& operator= | ( | const cPrecollectionBasedDensityEst & | res | ) |
Assignment operator. The name member is not copied; see cNamedObject's operator=() for more details.
|
overridevirtual |
Serializes the object into an MPI send buffer. Used by the simulation kernel for parallel execution. See cObject for more details.
Reimplemented from cStdDev.
Reimplemented in cLegacyHistogram, cKSplit, cVarHistogram, 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 cStdDev.
Reimplemented in cLegacyHistogram, cKSplit, cVarHistogram, and cLegacyHistogramBase.
|
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.
Reimplemented in cLongHistogram.
Referenced by cLongHistogram::collect().
|
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 |
Clears the results collected so far.
Reimplemented from cStdDev.
Reimplemented in cKSplit, cVarHistogram, and cLegacyHistogramBase.
|
overridevirtual |
Writes the contents of the object into a text file.
Reimplemented from cStdDev.
Reimplemented in cLegacyHistogram, cKSplit, cVarHistogram, and cLegacyHistogramBase.
|
overridevirtual |
Reads the object data from a file, in the format written out by saveToFile().
Reimplemented from cStdDev.
Reimplemented in cLegacyHistogram, cKSplit, cVarHistogram, and cLegacyHistogramBase.
|
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.
Reimplemented in cLegacyHistogram.
|
protectedpure virtual |
Called internally by collect(), this method collects a value after the histogram bins have been set up. Updating the underflow/overflow bins must be handled within this function. This is a pure virtual function; it must be redefined in subclasses.
Implemented in cLegacyHistogram, cKSplit, and cVarHistogram.
|
protectedpure virtual |
Called internally by collect(), this method collects a value after the histogram bin have been set up. Updating the underflow/overflow bins must be handled within this function. This is a pure virtual function; it must be redefined in subclasses.
Implemented in cLegacyHistogram, cKSplit, and cVarHistogram.
|
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.