OMNeT++ Simulation Library
6.0.3
|
18 #ifndef __OMNETPP_CKSPLIT_H
19 #define __OMNETPP_CKSPLIT_H
21 #include "cprecolldensityest.h"
99 void init(
const cKSplit& ksplit,
bool atbeginning=
true);
104 void operator++(
int);
109 void operator--(
int);
114 bool end()
const {
return grid==0;}
129 double getCellMax()
const {
return gridmin+(cell+1)*cellsize;}
140 double getCellValue()
const;
143 friend class Iterator;
150 int rootGridIndex, lastGridIndex;
151 bool rangeExtEnabled;
159 mutable Iterator *iter;
160 mutable long iterNumValues;
163 void copy(
const cKSplit& other);
167 void resetGrids(
int grid);
170 void createRootGrid();
173 void newRootGrids(
double value,
double weight);
176 void insertIntoGrids(
double value,
double weight,
int enableSplits);
179 void splitCell(
int grid,
int cell);
182 void distributeMotherObservations(
int grid);
185 void expandGridVector();
188 void iteratorToCell(
int cell_nr)
const;
200 explicit cKSplit(
const char *name=
nullptr,
bool weighted=
false);
232 virtual void parsimPack(
cCommBuffer *buffer)
const override;
239 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
247 virtual void collectIntoHistogram(
double val)
override;
252 virtual void collectWeightedIntoHistogram(
double value,
double weight)
override;
261 virtual void setUpBins()
override;
266 virtual int getNumBins()
const override;
271 virtual double getBinEdge(
int k)
const override;
276 virtual double getBinValue(
int k)
const override;
281 virtual void merge(
const cStatistic *other)
override;
286 virtual void clear()
override;
291 virtual void saveToFile(FILE *)
const override;
296 virtual void loadFromFile(FILE *)
override;
306 void setCritFunc(CritFunc _critfunc,
double *_critdata);
312 void setDivFunc(DivFunc _divfunc,
double *_divdata);
322 void setRangeExtension(
bool enabled);
331 int getTreeDepth()
const;
336 int getTreeDepth(Grid& grid)
const;
342 double getRealCellValue(Grid& grid,
int cell)
const;
347 void printGrids()
const;
363 int critfunc_const(
const cKSplit&, cKSplit::Grid&,
int,
double *);
364 int critfunc_depth(
const cKSplit&, cKSplit::Grid&,
int,
double *);
367 double divfunc_const(
const cKSplit&, cKSplit::Grid&,
double,
double *);
368 double divfunc_babak(
const cKSplit&, cKSplit::Grid&,
double,
double *);
int getCellNumber() const
Definition: cksplit.h:119
virtual cKSplit * dup() const override
Definition: cksplit.h:225
Grid & getGrid(int k) const
Definition: cksplit.h:352
Walks along cells of the distribution stored in a cKSplit object.
Definition: cksplit.h:78
Supporting struct for cKSplit. Represents one grid in the k-split data structure.
Definition: cksplit.h:54
double getCellMax() const
Definition: cksplit.h:129
int parent
index of parent grid
Definition: cksplit.h:56
double mother
observations 'inherited' from mother cell
Definition: cksplit.h:59
double total
sum of cells & all subgrids (also includes 'mother')
Definition: cksplit.h:58
Implements k-split, an adaptive histogram-like density estimation algorithm. During result collection...
Definition: cksplit.h:44
int reldepth
depth = (reldepth - rootgrid's reldepth)
Definition: cksplit.h:57
Base class for histogram-like density estimation classes.
Definition: cprecolldensityest.h:55
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34
Grid & getRootGrid() const
Definition: cksplit.h:357
double getCellMin() const
Definition: cksplit.h:124
double getCellSize() const
Definition: cksplit.h:134
bool end() const
Definition: cksplit.h:114
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41