16 #ifndef __OMNETPP_CSTATISTIC_H 17 #define __OMNETPP_CSTATISTIC_H 21 #include "opp_string.h" 41 void freadvarsf (FILE *f,
const char *fmt, ...) _OPP_GNU_ATTRIBUTE((format(scanf, 3, 4)));
81 virtual void parsimPack(
cCommBuffer *buffer)
const override;
88 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
96 virtual bool isWeighted()
const = 0;
101 virtual void collect(
double value) = 0;
111 virtual void collectWeighted(
double value,
double weight);
133 virtual void merge(
const cStatistic *other) = 0;
139 virtual void clear() = 0;
148 virtual int64_t getCount()
const = 0;
155 virtual double getSum()
const = 0;
162 virtual double getSqrSum()
const = 0;
167 virtual double getMin()
const = 0;
172 virtual double getMax()
const = 0;
177 virtual double getMean()
const = 0;
182 virtual double getStddev()
const = 0;
187 virtual double getVariance()
const = 0;
195 virtual double getSumWeights()
const = 0;
200 virtual double getWeightedSum()
const = 0;
205 virtual double getSqrSumWeights()
const = 0;
210 virtual double getWeightedSqrSum()
const = 0;
220 virtual void saveToFile(FILE *)
const = 0;
226 virtual void loadFromFile(FILE *) = 0;
238 virtual void record() {recordAs(
nullptr,
nullptr);}
259 virtual void recordAs(
const char *name,
const char *unit=
nullptr);
267 _OPPDEPRECATED
virtual double getWeights() const final {
return getSumWeights();}
272 _OPPDEPRECATED
virtual void collect2(
double value,
double weight)
final {collectWeighted(value, weight);}
277 _OPPDEPRECATED
virtual void collect2(
SimTime value,
double weight)
final {collectWeighted(value, weight);}
282 _OPPDEPRECATED
virtual void collect2(
double value,
SimTime weight)
final {collectWeighted(value, weight);}
292 _OPPDEPRECATED
virtual double random() const final {
return draw();}
virtual _OPPDEPRECATED double random() const final
Definition: cstatistic.h:292
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
virtual void collectWeighted(SimTime value, SimTime weight)
Definition: cstatistic.h:126
virtual void collect(SimTime value)
Definition: cstatistic.h:106
virtual _OPPDEPRECATED double getWeights() const final
Definition: cstatistic.h:267
virtual void record()
Definition: cstatistic.h:238
virtual _OPPDEPRECATED void collect2(SimTime value, double weight) final
Definition: cstatistic.h:277
virtual void collectWeighted(double value, SimTime weight)
Definition: cstatistic.h:121
double dbl() const
Definition: simtime.h:301
virtual void collectWeighted(SimTime value, double weight)
Definition: cstatistic.h:116
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
Lightweight string-to-string map, used internally in some parts of OMNeT++.
Definition: opp_string.h:200
virtual _OPPDEPRECATED void collect2(double value, double weight) final
Definition: cstatistic.h:272
Definition: cabstracthistogram.h:21
Abstract interface for random variate generator classes.
Definition: crandom.h:31
virtual void recordWithUnit(const char *unit)
Definition: cstatistic.h:249
virtual _OPPDEPRECATED void collect2(SimTime value, SimTime weight) final
Definition: cstatistic.h:287
virtual _OPPDEPRECATED void collect2(double value, SimTime weight) final
Definition: cstatistic.h:282
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34
virtual _OPPDEPRECATED void clearResult() final
Definition: cstatistic.h:297