public class TallyRunning extends Tally
TallyRunning
class is extended from
Tally
. Same as Tally
, it provides statistic
analysis about one value (mean, standard deviation, minimum, maximum).
In addition, this class is able to calculate this data based on
the last n samples only, subject to n passed to the
constructor.Tally
UNDEFINED
Constructor and Description |
---|
TallyRunning(Model ownerModel,
java.lang.String name,
int n,
boolean showInReport,
boolean showInTrace)
Constructor for a Tally object that has no connection to a
ValueSupplier . |
TallyRunning(Model ownerModel,
java.lang.String name,
ValueSupplier valSup,
int n,
boolean showInReport,
boolean showInTrace)
Constructor for a TallyRunning object that is connected to a
ValueSupplier . |
Modifier and Type | Method and Description |
---|---|
Reporter |
createDefaultReporter()
Returns a Reporter to produce a report about this Tally.
|
double |
getMaximumLastN()
Returns the maximum of the last n values.
|
double |
getMeanLastN()
Returns the mean value of the last n values observed.
|
double |
getMinimumLastN()
Returns the minimum of the last n values.
|
int |
getSampleSizeN()
Returns the sample size n.
|
double |
getStdDevLastN()
Returns the standard deviation of the last n values observed.
|
void |
reset()
Resets this TallyRunning object by resetting all variables to 0.0 .
|
void |
update()
Updates this
TallyRunning object by fetching the actual value of
the ValueSupplier and processing it. |
void |
update(double val)
Updates this
TallyRunning 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. |
getLastValue, getMaximum, getMinimum, update
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 TallyRunning(Model ownerModel, java.lang.String name, ValueSupplier valSup, int n, boolean showInReport, boolean showInTrace)
ValueSupplier
.ownerModel
- Model : The model this Tally is associated toname
- java.lang.String : The name of this Tally objectvalSup
- ValueSupplier : The ValueSupplier providing the value for this
Tally. The given ValueSupplier will be observed by this Tally
object.n
- int : Number of samples to include in running statistic data.showInReport
- boolean : Flag for showing the report about this Tally.showInTrace
- boolean : Flag for showing the trace output of this Tally.public TallyRunning(Model ownerModel, java.lang.String name, int n, boolean showInReport, boolean showInTrace)
ValueSupplier
.ownerModel
- Model : The model this Tally is associated toname
- java.lang.String : The name of this Tally objectn
- int : Number of samples to include in running statistic data.showInReport
- boolean : Flag for showing the report about this Tally.showInTrace
- boolean : Flag for showing the trace output of this Tally.public Reporter createDefaultReporter()
createDefaultReporter
in class Tally
public double getMeanLastN()
public double getStdDevLastN()
public void reset()
public void update()
TallyRunning
object by fetching the actual value of
the ValueSupplier
and processing it. The
ValueSupplier
is passed in the constructor of this
TallyRunning
object. This update()
method complies
with the one described in DESMO, see [Page91].public void update(double val)
TallyRunning
object with the double value given as
parameter. In some cases it might be more convenient to pass the value
this TallyRunning
will be updated with directly within the
update(double val)
method instead of going via the
ValueSupplier
.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.update
in interface java.util.Observer
update
in class Tally
o
- java.util.Observable : The Observable calling this method
within its own notifyObservers()
method.arg
- Object : The Object with which this TallyRunning
is
updated. Normally a double number which is added to the
statistics or null
.public double getMaximumLastN()
public double getMinimumLastN()
public int getSampleSizeN()