cLongHistogram Class Reference
[Statistical data collection]

#include <chistogram.h>

Inheritance diagram for cLongHistogram:

cEqdHistogramBase cHistogramBase cDensityEstBase cStdDev cStatistic cOwnedObject cNamedObject cObject

List of all members.


Detailed Description

Equidistant histogram for integers.

cLongHistogram is derived from cEqdHistogramBase, which contains most of the functionality.

The histogram will be set up in the following way:

Examples:

This histogram will determine the range from the first few observations, then it will try to keep maintain 1 cell for each integer value in the range. If there would be more than 10,000 cells that way, it will make 2 or 3 or 4 etc. wide cells to reduce the number of cells below 10,000.

 cLongHistogram hist("hist");

The following histogram will maintain one cell for every integer 0,1,...500.

 cLongHistogram hist("hist");
 hist.setRange(0,500);

The next one will set up 100 cells, and the range will be auto-determined from the first few observations. If the range is <100 wide, every cell will be 1 wide; with the range width in 100..200, cells will be 2 wide, etc.

 cLongHistogram hist("hist");
 hist.setNumCells(100);

If you know that the numbers will be nonnegative, but you don't know their ranges, you can use the following (which will set up 20 cells, with the range 0..20, or 0..40, or 0..60 etc, depending on the range of the initial observations):

 cLongHistogram hist("hist");
 hist.setRangeAutoUpper(0);
 hist.setNumCells(20);

Public Member Functions

Constructors, destructor, assignment.
 cLongHistogram (const cLongHistogram &r)
 cLongHistogram (const char *name=NULL, int numcells=-1)
virtual ~cLongHistogram ()
cLongHistogramoperator= (const cLongHistogram &)
Redefined cObject member functions.
virtual cLongHistogramdup () const
Redefined member functions from cStatistic and its subclasses.
virtual void collect (double value)
virtual void collect (SimTime value)
virtual double random () const

Protected Member Functions

virtual void setupRange ()

Constructor & Destructor Documentation

cLongHistogram::cLongHistogram ( const cLongHistogram r  )  [inline]

cLongHistogram::cLongHistogram ( const char *  name = NULL,
int  numcells = -1 
) [explicit]

Constructor.

virtual cLongHistogram::~cLongHistogram (  )  [virtual]

Destructor.


Member Function Documentation

cLongHistogram& cLongHistogram::operator= ( const cLongHistogram  )  [inline]

Assignment is not supported by this class: this method throws a cRuntimeError when called.

References cObject::copyNotSupported().

virtual cLongHistogram* cLongHistogram::dup (  )  const [inline, virtual]

Creates and returns an exact copy of this object.

See cObject for more details.

Reimplemented from cStdDev.

virtual void cLongHistogram::setupRange (  )  [protected, virtual]

Called internally by transform(), this method should determine and set up the histogram range.

Reimplemented from cEqdHistogramBase.

virtual void cLongHistogram::collect ( double  value  )  [virtual]

Collects one value.

Internally, the double value is converted to a long using floor() before any processing.

Reimplemented from cDensityEstBase.

virtual void cLongHistogram::collect ( SimTime  value  )  [inline, virtual]

Convenience method, delegates to collect(double).

Reimplemented from cDensityEstBase.

References cDensityEstBase::collect(), and SimTime::dbl().

virtual double cLongHistogram::random (  )  const [virtual]

Returns a random number based on the distribution collected.

If no values have been collected, it returns 0; when in initial collection phase, it returns one of the stored observations; after the histogram has been set up, a random integer is returned.

Reimplemented from cStdDev.


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

Generated on Thu Feb 26 14:50:56 2009 for OMNeT++ Simulation Library by  doxygen 1.5.5