#include <cstat.h>
Inheritance diagram for cStatistic::
Public Methods | |
Constructors, destructor, assignment. | |
cStatistic (const cStatistic &r) | |
cStatistic (const char *name=NULL) | |
virtual | ~cStatistic () |
cStatistic& | operator= (const cStatistic &res) |
Redefined cObject member functions. | |
virtual int | netPack () |
virtual int | netUnpack () |
Collecting values. | |
virtual void | collect (double val)=0 |
virtual void | collect2 (double val, double weight) |
void | operator+= (double val) |
virtual void | clearResult ()=0 |
Statistics of collected data. | |
virtual long | samples () const=0 |
virtual double | weights () const=0 |
virtual double | sum () const=0 |
virtual double | sqrSum () const=0 |
virtual double | min () const=0 |
virtual double | max () const=0 |
virtual double | mean () const=0 |
virtual double | stddev () const=0 |
virtual double | variance () const=0 |
Transient and result accuracy detection. | |
void | addTransientDetection (cTransientDetection *object) |
void | addAccuracyDetection (cAccuracyDetection *object) |
cTransientDetection* | transientDetectionObject () const |
cAccuracyDetection* | accuracyDetectionObject () const |
Generating random numbers based on the collected data | |
void | setGenK (int gen_nr) |
virtual double | random () const=0 |
Writing to text file, reading from text file. | |
virtual void | saveToFile (FILE *) const=0 |
virtual void | loadFromFile (FILE *)=0 |
|
Copy constructor. |
|
Constructor, creates an object with the given name |
|
The destructor does nothing. |
|
Returns the assigned transient and accuracy detection objects. |
|
Assigns transient and accuracy detection objects to the statistic object. |
|
Assigns transient and accuracy detection objects to the statistic object. |
|
This function should be redefined in derived classes to clear the results collected so far. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cDensityEstBase, cHistogramBase, cStdDev, cWeightedStdDev, and cVarHistogram. |
|
Collects one value. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cDensityEstBase, cLongHistogram, cStdDev, and cWeightedStdDev. |
|
Collects one value with a given weight. Reimplemented in cWeightedStdDev. |
|
Reads the object data from a file written out by saveToFile(). This method is pure virtual, implementation is provided in subclasses. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cKSplit, cPSquare, cStdDev, cWeightedStdDev, and cVarHistogram. |
|
Returns the maximum of the samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev. |
|
Returns the mean of the samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev, and cWeightedStdDev. |
|
Returns the minimum of the samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev. |
|
Serializes the object into a PVM or MPI send buffer. Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cObject. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, cStdDev, cWeightedStdDev, and cVarHistogram. |
|
Deserializes the object from a PVM or MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cObject. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, cStdDev, cWeightedStdDev, and cVarHistogram. |
|
Same as the collect(double) method. |
|
Assignment operator. It is present since descendants may refer to it. The name member doesn't get copied; see cObject's operator=() for more details. |
|
Generates a random number based on the collected data. Uses the random number generator set by setGenK(). This method is pure virtual, implementation is provided in subclasses. Reimplemented in cDensityEstBase, cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, cStdDev, and cVarHistogram. |
|
Returns the number of samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev. |
|
Writes the contents of the object into a text file. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cKSplit, cPSquare, cStdDev, cWeightedStdDev, and cVarHistogram. |
|
Sets the index of the random number generator to use when the object has to generate a random number based on the statistics stored. |
|
Returns the squared sum of the collected data. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev. |
|
Returns the standard deviation of the samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev. |
|
Returns the sum of samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev. |
|
Returns the assigned transient and accuracy detection objects. |
|
Returns the variance of the samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev, and cWeightedStdDev. |
|
Returns the sum of weights of the samples collected. This method is pure virtual, implementation is provided in subclasses. Reimplemented in cStdDev, and cWeightedStdDev. |