public abstract class ValueStatistics extends StatisticObjectSupportingTimeSpans
ValueStatistics
class is the super class for all the
classes providing a statistic analysis about one value (e.g. minimum and
maximum values). Derived classes are: Tally, Accumulate and Histogram
(because it is derived from Tally).UNDEFINED
Constructor and Description |
---|
ValueStatistics(Model ownerModel,
java.lang.String name,
boolean showInReport,
boolean showInTrace)
Constructor for a ValueStatistics object that has NO connection to a
ValueSupplier . |
ValueStatistics(Model ownerModel,
java.lang.String name,
ValueSupplier valSup,
boolean showInReport,
boolean showInTrace)
Constructor for a ValueStatistics object that will be connected to a
ValueSupplier . |
Modifier and Type | Method and Description |
---|---|
double |
getLastValue()
Returns the last observed value of this ValueStatistics object.
|
double |
getMaximum()
Returns the maximum value observed so far.
|
abstract double |
getMean()
Returns the mean value of all the values observed so far.
|
double |
getMinimum()
Returns the minimum value observed so far.
|
abstract double |
getStdDev()
Returns the standard deviation of all the values observed so far.
|
void |
reset()
Resets this ValueStatistics object by resetting all variables to 0.0 .
|
void |
update()
Updates this
ValueStatistics object by fetching the actual
value of the ValueSupplier and processing it. |
void |
update(double val)
Updates this
ValueStatistics object with the double value
given as parameter. |
void |
update(java.util.Observable o,
java.lang.Object arg)
Implementation of the virtual
update(Observable, Object)
method of the Observer interface. |
void |
update(TimeSpan t)
Updates this data collector object with a specific
TimeSpan . |
getShowTimeSpansInReport, getUnit, setShowTimeSpansInReport
getUnitText, round, setUnit
getCorrespondingSchedulable, getDescription, getObservations, getReporter, incrementObservations, incrementObservations, reportIsOn, reportOff, reportOn, resetAt, setCorrespondingSchedulable, setDescription, setReporter
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public ValueStatistics(Model ownerModel, java.lang.String name, ValueSupplier valSup, boolean showInReport, boolean showInTrace)
ValueSupplier
.ownerModel
- Model : The model this ValueStatistics is associated toname
- java.lang.String : The name of this ValueStatistics objectvalSup
- ValueSupplier : The ValueSupplier providing the value for this
ValueStatistics. The given ValueSupplier will be observed by
this ValueStatistics object.showInReport
- boolean : Flag for showing the report about this
ValueStatistics.showInTrace
- boolean : Flag for showing the trace output of this
ValueStatistics.public ValueStatistics(Model ownerModel, java.lang.String name, boolean showInReport, boolean showInTrace)
ValueSupplier
.ownerModel
- Model : The model this ValueStatistics is associated toname
- java.lang.String : The name of this ValueStatistics objectshowInReport
- boolean : Flag for showing the report about this
ValueStatistics.showInTrace
- boolean : Flag for showing the trace output of this
ValueStatistics.public double getLastValue()
public double getMaximum()
public abstract double getMean()
public double getMinimum()
public abstract double getStdDev()
public void reset()
reset
in class Reportable
public void update(TimeSpan t)
StatisticObjectSupportingTimeSpans
TimeSpan
.update
in class StatisticObjectSupportingTimeSpans
t
- TimeSpan : The time span to update this data collector.public void update()
ValueStatistics
object by fetching the actual
value of the ValueSupplier
and processing it. The
ValueSupplier
is passed in the constructor of this
ValueStatistics
object. This update()
method complies with the one described in DESMO, see [Page91].public void update(double val)
ValueStatistics
object with the double value
given as parameter. In some cases it might be more convenient to pass the
value this ValueStatistics
will be updated with directly
within the update(double val)
method instead of going via
the ValueSupplier
.val
- double : The value with which this
ValueStatistics
will be updated.public void update(java.util.Observable o, java.lang.Object arg)
update(Observable, Object)
method of the Observer
interface. This method will be
called automatically from an Observable
object within its
notifyObservers()
method. null
value) is passed as arg, the actual
value of the ValueSupplier will be fetched with the value()
method of the ValueSupplier. Otherwise it is expected that the actual
value is passed in the Object arg.o
- java.util.Observable : The Observable calling this method
within its own notifyObservers()
method.arg
- Object : The Object with which this
ValueStatistics
is updated. Normally a double
number or TimeSpan which is added to the statistics or
null
.