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, numberFormat
EOL
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, toString
protected 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)
SampleStatistics
newObservation
in interface SampleStatistics
newObservation
in class AbstractSimpleStats
x
- The new (primitive) observationpublic double getMean()
SampleStatistics
getMean
in interface SampleStatistics
public double getVariance()
SampleStatistics
getVariance
in interface SampleStatistics
public double getStandardDeviation()
SampleStatistics
getStandardDeviation
in interface SampleStatistics
public SamplingType getSamplingType()
SampleStatistics
getSamplingType
in interface SampleStatistics
TIME_VARYING
.public void setSamplingType(SamplingType type)
TIME_VARYING
.setSamplingType
in interface SampleStatistics
setSamplingType
in class AbstractSimpleStats
type
- Given type (ignored)public void reset()
SampleStatistics
reset
in interface SampleStatistics
reset
in class AbstractSimpleStats
public void setEventListID(int id)
setEventListID
in interface EventListAware
public void setEventList(BasicEventList list)
setEventList
in interface EventListAware
public int getEventListID()
getEventListID
in interface EventListAware
public BasicEventList getEventList()
getEventList
in interface EventListAware
public double getStartTime()