OMNeT++ API 6.1
Discrete Event Simulation Library
cDefaultHistogramStrategy Class Reference

Description

A strategy class used by the default setup of cHistogram. It is meant to provide a good quality uniform-bin histogram without requiring manual configuration.

This strategy uses precollection to gather input information about the distribution before setting up the bins. Precollection is used to determine the initial histogram range and the histogram mode (integers vs. reals). In integers mode, bin edges will be whole numbers.

To keep up with distributions that change over time, this histogram strategy can auto-extend the histogram range by adding new bins as needed. It also performs bin merging when necessary, to keep the number of bins reasonably low.

Collected infinities are counted as underflows/overflows, and they do not affect the histogram layout in any way.

Inheritance diagram for cDefaultHistogramStrategy:
[legend]

Public Member Functions

Constructors, copying.
 cDefaultHistogramStrategy (int numBinsHint=-1, Mode mode=cHistogram::MODE_AUTO)
 
 cDefaultHistogramStrategy (const cDefaultHistogramStrategy &other)
 
cDefaultHistogramStrategyoperator= (const cDefaultHistogramStrategy &other)
 
virtual cDefaultHistogramStrategydup () const override
 
Configuring.
int getNumBinsHint () const
 
void setNumBinsHint (int numBins)
 
Redefined cIHistogramStrategy methods.
virtual void collect (double value) override
 
virtual void collectWeighted (double value, double weight) override
 
virtual void clear () override
 
- Public Member Functions inherited from cPrecollectionBasedHistogramStrategy
 cPrecollectionBasedHistogramStrategy ()
 
 cPrecollectionBasedHistogramStrategy (const cPrecollectionBasedHistogramStrategy &other)
 
cPrecollectionBasedHistogramStrategyoperator= (const cPrecollectionBasedHistogramStrategy &other)
 
int getNumToPrecollect () const
 
void setNumToPrecollect (int numToPrecollect)
 
int getNumToCollate () const
 
void setNumToCollate (int numToCollate)
 
int getRangeUnchangedThreshold () const
 
void setRangeUnchangedThreshold (int threshold)
 
virtual void setUpBins () override
 
- Public Member Functions inherited from cIHistogramStrategy
 cIHistogramStrategy ()
 
 cIHistogramStrategy (const cIHistogramStrategy &other)
 
cIHistogramStrategyoperator= (const cIHistogramStrategy &other)
 
void setHistogram (cHistogram *hist)
 
cHistogramgetHistogram () const
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)=default
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
virtual const char * getName () 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 cObjectgetThisPtr () const
 
virtual std::string str () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual void parsimPack (cCommBuffer *buffer) const
 
virtual void parsimUnpack (cCommBuffer *buffer)
 
virtual cObjectgetOwner () const
 
virtual bool isOwnedObject () const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Additional Inherited Members

- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Member Function Documentation

◆ dup()

virtual cDefaultHistogramStrategy* dup ( ) const
inlineoverridevirtual

Should be redefined in subclasses to create an exact copy of this object. The default implementation just throws an error, to indicate that the method was not redefined.

Reimplemented from cObject.

◆ collect()

virtual void collect ( double  value)
overridevirtual

Called from cHistogram's collect() method. Implementations are expected to call back cHistogram's collectIntoHistogram(), or if histogram bins are not yet set up, store it for later.

Implements cIHistogramStrategy.

◆ collectWeighted()

virtual void collectWeighted ( double  value,
double  weight 
)
overridevirtual

Called from cHistogram's collectWeighted() method. Implementations are expected to call back cHistogram's collectIntoHistogram(), or if histogram bins are not yet set up, store it for later.

Implements cIHistogramStrategy.

◆ clear()

virtual void clear ( )
inlineoverridevirtual

Called from cHistogram's clear() method, to give the strategy object an opportunity to clear its state.

Reimplemented from cPrecollectionBasedHistogramStrategy.

References cPrecollectionBasedHistogramStrategy::clear().


The documentation for this class was generated from the following file: