|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_CHISTOGRAM_H
17 #define __OMNETPP_CHISTOGRAM_H
20 #include "cabstracthistogram.h"
24 class cIHistogramStrategy;
25 class cAutoRangeHistogramStrategy;
95 enum Mode {MODE_AUTO, MODE_INTEGERS, MODE_REALS, MODE_DOUBLES = MODE_REALS};
100 std::vector<double> binEdges;
101 std::vector<double> binValues;
102 double finiteUnderflowSumWeights = 0, finiteOverflowSumWeights = 0;
103 double posInfSumWeights = 0, negInfSumWeights = 0;
108 virtual void collectIntoHistogram(
double value,
double weight=1);
125 explicit cHistogram(
const char *name=
nullptr,
bool weighted=
false);
131 explicit cHistogram(
const char *name,
int numBinsHint,
bool weighted=
false);
170 virtual void parsimPack(
cCommBuffer *buffer)
const override;
177 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
187 virtual void collect(
double value)
override;
196 virtual void collectWeighted(
double value,
double weight)
override;
202 virtual void clear()
override;
207 virtual void saveToFile(FILE *f)
const override;
212 virtual void loadFromFile(FILE *f)
override;
217 virtual void merge(
const cStatistic *other)
override;
238 virtual bool binsAlreadySetUp()
const override;
245 virtual void setUpBins()
override;
252 virtual void setBinEdges(
const std::vector<double>& edges);
260 virtual void createUniformBins(
double lo,
double hi,
double step);
268 virtual void prependBins(
const std::vector<double>& edges);
276 virtual void appendBins(
const std::vector<double>& edges);
287 virtual void extendBinsTo(
double value,
double step,
int maxNumBins=INT_MAX);
295 virtual void mergeBins(
int groupSize);
301 virtual std::vector<double>
getBinEdges()
const override {
return binEdges;}
307 virtual std::vector<double>
getBinValues()
const override {
return binValues;}
312 virtual int getNumBins()
const override {
return binValues.size();}
317 virtual double getBinEdge(
int k)
const override {
return binEdges.at(k);}
323 virtual double getBinValue(
int k)
const override {
return binValues.at(k);}
340 virtual int64_t getNumUnderflows()
const override;
347 virtual int64_t getNumOverflows()
const override;
354 virtual int64_t getNumNegInfs()
const override;
361 virtual int64_t getNumPosInfs()
const override;
382 virtual void setMode(Mode mode);
390 virtual void setRange(
double lower,
double upper);
397 virtual void setNumPrecollectedValues(
int numPrecollect);
405 virtual void setRangeExtensionFactor(
double rangeExtensionFactor);
414 virtual void setAutoExtend(
bool autoExtend);
421 virtual void setNumBinsHint(
int numCells);
428 virtual void setBinSizeHint(
double d);
cIHistogramStrategy * getStrategy() const
Definition: chistogram.h:232
virtual int getNumBins() const override
Definition: chistogram.h:312
virtual double getBinValue(int k) const override
Definition: chistogram.h:323
virtual std::vector< double > getBinEdges() const override
Definition: chistogram.h:301
virtual double getBinEdge(int k) const override
Definition: chistogram.h:317
virtual void collect(double value) override
virtual std::vector< double > getBinValues() const override
Definition: chistogram.h:307
cHistogram(const cHistogram &other)
Definition: chistogram.h:142
virtual double getUnderflowSumWeights() const override
Definition: chistogram.h:328
virtual double getPosInfSumWeights() const override
Definition: chistogram.h:371
A generic, very configurable histogram strategy that is meant to provide a good quality histogram for...
Definition: chistogramstrategy.h:304
virtual double getNegInfSumWeights() const override
Definition: chistogram.h:366
Generic histogram class, capable of representing both unweighted and weighted distributions....
Definition: chistogram.h:88
virtual cHistogram * dup() const override
Definition: chistogram.h:163
Interface for histogram strategy classes. Histogram strategies encapsulate the task of setting up and...
Definition: chistogramstrategy.h:29
Interface and base class for histogram-like density estimation classes.
Definition: cabstracthistogram.h:26
virtual void collectWeighted(double value, double weight) override
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34
Mode
Definition: chistogram.h:95
virtual double getOverflowSumWeights() const override
Definition: chistogram.h:333
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41