OMNeT++ Simulation Library
5.6.1

The primary way of recording statistics from simulations is by means of signals and declared statistics, i.e. using @statistic properties in NED files. However, the simulation library also provides some classes in case programmatic result collection is needed.
Scalar values can be recorded in the output scalar file with the recordScalar() method of the module or channel. To collect statistic summaries (mean, stddev, etc.) or histograms, use the cStdDev and cHistogram classes. Their contents can be recorded into the output scalar file with the recordStatistic() method of the module or channel, or with the record() method of the statistic object itself. To record output vectors (time series data), use the cOutVector class.
Declarative (@statisticbased) result recording is also extensible, via the cResultFilter and cResultRecorder classes.
All result collection methods eventually delegate to "record" methods in cEnvir, i.e. the actual recording is decoupled from the result collection classes and can be changed without changing model code.
The central classes are:
Some other classes closely related to the above ones are not listed here explicitly, but you can find them via 'See also' links from their main classes.
Classes  
class  cHistogram 
Generic histogram class, capable of representing both unweighted and weighted distributions. Histogram data are stored as n+1 bin edges and n bin values, both being doubleprecision floating point values. Upper and lower outliers (as well as positive and negative infinities) are kept as counts (for unweighted statistics) or as sum of weights (for weighted statistics). More...  
class  cIHistogramStrategy 
Interface for histogram strategy classes. Histogram strategies encapsulate the task of setting up and managing the bins in a cHistogram. More...  
class  cFixedRangeHistogramStrategy 
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. More...  
class  cPrecollectionBasedHistogramStrategy 
Base class for histogram strategies that employ a precollection phase in order to gather input for setting up the bins. This class provides storage for the precollected values, and also a builtin algorithm for deciding when to stop precollection. More...  
class  cDefaultHistogramStrategy 
A strategy class used by the default setup of cHistogram. It is meant to provide a good quality uniformbin histogram without requiring manual configuration. More...  
class  cAutoRangeHistogramStrategy 
A generic, very configurable histogram strategy that is meant to provide a good quality histogram for practical distributions, and creates uniform bins. This strategy uses precollection to gather input information about the distribution before setting up the bins. More...  
class  cKSplit 
Implements ksplit, an adaptive histogramlike density estimation algorithm. During result collection, ksplit will dynamically subdivide "busy" bins (ones that collect a large number of observations), thereby refining the resolution of the histogram where needed. More...  
class  cLegacyHistogramBase 
Base class for histogram classes. It adds a vector of counters to cPrecollectionBasedDensityEst. More...  
class  cLegacyHistogram 
Implements an equidistant histogram. More...  
class  cLongHistogram 
Equidistant histogram for integers. More...  
class  cDoubleHistogram 
Equidistant histogram for doubles. More...  
class  cOutVector 
Responsible for recording vector simulation results (an output vector). More...  
class  cPrecollectionBasedDensityEst 
Base class for histogramlike density estimation classes. More...  
class  cPSquare 
Implements the P^{2} algorithm, which calculates quantile values without storing the observations. See the seminal paper titled "The P^2 Algorithm for Dynamic Statistical Computing Calculation of
Quantiles and Histograms Without Storing Observations" by Raj Jain and Imrich Chlamtac. More...  
class  cResultFilter 
Base class for result filters. More...  
class  cResultRecorder 
Abstract base class for result recorders. More...  
class  cStatistic 
cStatistic is an abstract class for computing statistical properties of a random variable. More...  
class  cStdDev 
Statistics class to collect min, max, mean, and standard deviation. More...  
class  cWeightedStdDev 
Statistics class to collect doubles and calculate weighted statistics from them. One application is to calculate time average. More...  
class  cVarHistogram 
Variable bin size histogram. More...  
Typedefs  
typedef int(*  CritFunc) (const cKSplit &, cKSplit::Grid &, int, double *) 
typedef double(*  DivFunc) (const cKSplit &, cKSplit::Grid &, double, double *) 
typedef void(*  RecordFunc) (void *, simtime_t, double) 
Prototype for callback functions that are used to notify graphical user interfaces when values are recorded to an output vector (see cOutVector). More...  
typedef int(* CritFunc) (const cKSplit &, cKSplit::Grid &, int, double *) 
Prototype for cell split criterion functions used by cKSplit objects.
typedef double(* DivFunc) (const cKSplit &, cKSplit::Grid &, double, double *) 
Prototype for cell division criterion functions used by cKSplit objects.
typedef void(* RecordFunc) (void *, simtime_t, double) 
Prototype for callback functions that are used to notify graphical user interfaces when values are recorded to an output vector (see cOutVector).