Histogram strategy that sets up uniform bins over a predetermined interval. The number of bins and the histogram mode (integers or reals) also need to be configured. This strategy does not use precollection, as all input for setting up the bins must be explicitly provided by the user.
Bins are set up when the first value is collected, and never change afterwards. If you need a histogram strategy that supports dynamically extending the histogram with new bins, consider using cAutoRangeHistogramStrategy.
Public Member Functions | |
Constructors, copying. | |
cFixedRangeHistogramStrategy () | |
cFixedRangeHistogramStrategy (double lo, double hi, int numBins, Mode mode=cHistogram::MODE_REALS) | |
cFixedRangeHistogramStrategy (const cFixedRangeHistogramStrategy &other) | |
cFixedRangeHistogramStrategy & | operator= (const cFixedRangeHistogramStrategy &other) |
virtual cFixedRangeHistogramStrategy * | dup () const override |
Configuring. | |
void | setRange (double lo, double hi) |
double | getUpperLimit () const |
void | setUpperLimit (double hi) |
double | getLowerLimit () const |
void | setLowerLimit (double lo) |
Mode | getMode () const |
void | setMode (Mode mode) |
double | getBinSize () const |
void | setBinSize (double binSize) |
Redefined cIHistogramStrategy methods | |
virtual void | collect (double value) override |
virtual void | collectWeighted (double value, double weight) override |
virtual void | setUpBins () override |
virtual void | clear () override |
Public Member Functions inherited from cIHistogramStrategy | |
cIHistogramStrategy () | |
cIHistogramStrategy (const cIHistogramStrategy &other) | |
cIHistogramStrategy & | operator= (const cIHistogramStrategy &other) |
void | setHistogram (cHistogram *hist) |
cHistogram * | getHistogram () 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 cObject * | getThisPtr () 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 cObject * | getOwner () const |
virtual bool | isOwnedObject () 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 | |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
|
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.
|
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.
|
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.
|
overridevirtual |
cHistogram's setUpBins() method delegates here. Implementations are expected to create bins in the associated histogram by calling its setBinEdges() or createUniformBins() method, and move possibly existing precollected observations into the bins using collectIntoHistogram().
Implements cIHistogramStrategy.
|
inlineoverridevirtual |
Called from cHistogram's clear() method, to give the strategy object an opportunity to clear its state.
Implements cIHistogramStrategy.