public class SimpleStatsTimeVarying extends AbstractSimpleStats implements EventListAware
EventList.
Getting the mean, variance, or standard deviation will cause a new
observation to be added to account for the time since the last observation,
therefore the value returned by getCount may not correspond to
the number of times newObservation has been called.
| Modifier and Type | Field and Description |
|---|---|
protected double |
diff
The difference between the current observation and the mean.
|
protected BasicEventList |
eventList |
protected double |
lastTime
The time of the last observation.
|
protected double |
mean
The time weighted mean of the statistic.
|
protected double |
startTime
The time of the first observation.
|
protected double |
variance
The time weighted variance of the statistic.
|
count, DEFAULT_NAME, DEFAULT_NUMBER_FORMAT, maxObs, minObs, name, numberFormatEOL| Constructor and Description |
|---|
SimpleStatsTimeVarying()
Constructs a new SimpleStatsTimeVarying with the default name.
|
SimpleStatsTimeVarying(SimpleStatsTimeVarying original) |
SimpleStatsTimeVarying(java.lang.String name)
Constructs a new SimpleStatsTimeVarying with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
BasicEventList |
getEventList() |
int |
getEventListID() |
double |
getMean()
Gets the current value of the mean.
|
SamplingType |
getSamplingType()
Returns the SamplingType for this SampleStatistics.
|
double |
getStandardDeviation()
Gets the current value of the standard deviation.
|
double |
getStartTime() |
double |
getVariance()
Gets the current value of the variance.
|
void |
newObservation(double x)
Add new observation and update counters (primitive).
|
void |
reset()
Should reset/initialize all relevant counters.
|
void |
setEventList(BasicEventList list) |
void |
setEventListID(int id) |
void |
setSamplingType(SamplingType type)
Does nothing since the SamplingType is always
TIME_VARYING. |
clone, getCount, getDataLine, getMaxObs, getMinObs, getName, newObservation, newObservation, newObservation, propertyChange, setName, setNumberFormat, toStringprotected double mean
protected double variance
protected double diff
protected double lastTime
protected double startTime
protected BasicEventList eventList
public SimpleStatsTimeVarying(java.lang.String name)
name - The name of the property to collect statistics for.public SimpleStatsTimeVarying()
setName().public SimpleStatsTimeVarying(SimpleStatsTimeVarying original)
public void newObservation(double x)
SampleStatisticsnewObservation in interface SampleStatisticsnewObservation in class AbstractSimpleStatsx - The new (primitive) observationpublic double getMean()
SampleStatisticsgetMean in interface SampleStatisticspublic double getVariance()
SampleStatisticsgetVariance in interface SampleStatisticspublic double getStandardDeviation()
SampleStatisticsgetStandardDeviation in interface SampleStatisticspublic SamplingType getSamplingType()
SampleStatisticsgetSamplingType in interface SampleStatisticsTIME_VARYING.public void setSamplingType(SamplingType type)
TIME_VARYING.setSamplingType in interface SampleStatisticssetSamplingType in class AbstractSimpleStatstype - Given type (ignored)public void reset()
SampleStatisticsreset in interface SampleStatisticsreset in class AbstractSimpleStatspublic void setEventListID(int id)
setEventListID in interface EventListAwarepublic void setEventList(BasicEventList list)
setEventList in interface EventListAwarepublic int getEventListID()
getEventListID in interface EventListAwarepublic BasicEventList getEventList()
getEventList in interface EventListAwarepublic double getStartTime()