|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.sensors.TimeSeries
public class TimeSeries
This class represents a possibly multi-dimensional time series of a single sensor. It computes simply statistical values, can distinguish active from passive segments, and offers some convenience methods.
| Nested Class Summary | |
|---|---|
static interface |
TimeSeries.Parameters
This interface represents the parameters that must be reasonably set when initializing a time series that reads from sensors instead of from other time series. |
| Constructor Summary | |
|---|---|
TimeSeries(int windowSize)
Initializes the time series circular buffer with the specified window size. |
|
| Method Summary | |
|---|---|
void |
addNextStageSink(SamplesSink sink)
Registers a sink, which will receive all new values as they are sampled. |
void |
addSample(double sample,
int sampleNum)
Adds a new sample to the time series in-memory buffer, updates statistics and may forward to the next stage. |
double |
getActiveVarianceThreshold()
Gets the current value of activeVarianceThreshold. |
boolean |
getDifferencing()
Gets the current value of differencing. |
double |
getMultiplicator()
Gets the current value of multiplicator. |
double |
getOffset()
Gets the current value of offset. |
double[] |
getSamplesInWindow()
Returns all samples currently contained in the time window. |
boolean |
getSubtractTotalMean()
Gets the current value of subtractTotalMean. |
boolean |
getSubtractWindowMean()
Gets the current value of subtractWindowMean. |
double |
getTotalMean()
Returns the mean over all values added to this time series since its construction. |
double |
getTotalVariance()
Returns the variance over all values added to this time series since its construction. |
double |
getWindowMean()
Returns the mean over all values in the time series buffer, i.e. the last window size samples. |
double |
getWindowVariance()
Returns the variance over all values in the time series buffer, i.e. the last window size samples. |
boolean |
removeSink(SamplesSink sink)
Removes a previously registered sink. |
void |
reset()
Resets the time series to the state as created when freshly constructing it. |
void |
segmentEnd(int indexNotUsed)
Dummy implementation of SamplesSink.segmentEnd. |
void |
segmentStart(int indexNotUsed)
Dummy implementation of SamplesSink.segmentStart. |
void |
setActiveVarianceThreshold(double activeVarianceThreshold)
Sets the current value of activeVarianceThreshold. |
void |
setDifferencing(boolean differencing)
Sets the current value of differencing. |
void |
setMultiplicator(double multiplicator)
Sets the current value of multiplicator. |
void |
setOffset(double offset)
Sets the current value of offset. |
void |
setParameters(TimeSeries.Parameters pars)
Sets both the multiplicator and the offset according to the given parameters object. |
void |
setSubtractTotalMean(boolean subtractTotalMean)
Sets the current value of subtractTotalMean. |
void |
setSubtractWindowMean(boolean subtractWindowMean)
Sets the current value of subtractWindowMean. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimeSeries(int windowSize)
windowSize - Specifies the number of past samples kept in memory and used for
computing the window mean and variance.| Method Detail |
|---|
public void reset()
public void addSample(double sample,
int sampleNum)
addSample in interface SamplesSinksample - The sample value to add.sampleNum - The number of the sample to add. As this class keeps internal count
of how many samples have already been added, this is used for checking
that all samples are received and no duplicates happen. index is assumed
to start at 0.public void segmentStart(int indexNotUsed)
segmentStart in interface SamplesSinkindexNotUsed - The index at which the active segment starts.public void segmentEnd(int indexNotUsed)
segmentEnd in interface SamplesSinkindexNotUsed - The index at which the active segment ends.public void addNextStageSink(SamplesSink sink)
sink - The sink to push new pre-processed samples to.public boolean removeSink(SamplesSink sink)
sink - The sink to stop pushing samples to.
public double getTotalMean()
public double getTotalVariance()
public double getWindowMean()
public double getWindowVariance()
public double[] getSamplesInWindow()
public double getOffset()
offsetpublic void setOffset(double offset)
offset - The current value of offset.offsetpublic double getMultiplicator()
multiplicatorpublic void setMultiplicator(double multiplicator)
multiplicator - The current value of multiplicator.multiplicatorpublic boolean getSubtractWindowMean()
subtractWindowMeanpublic void setSubtractWindowMean(boolean subtractWindowMean)
subtractWindowMean - The current value of subtractWindowMean.subtractWindowMeanpublic boolean getSubtractTotalMean()
subtractTotalMeanpublic void setSubtractTotalMean(boolean subtractTotalMean)
subtractTotalMean - The current value of subtractTotalMean.subtractTotalMeanpublic boolean getDifferencing()
differencingpublic void setDifferencing(boolean differencing)
differencing - The current value of differencing.differencingpublic double getActiveVarianceThreshold()
activeVarianceThresholdpublic void setActiveVarianceThreshold(double activeVarianceThreshold)
activeVarianceThreshold - The current value of activeVarianceThreshold.activeVarianceThresholdpublic void setParameters(TimeSeries.Parameters pars)
pars - An object that can be queried for the values to be set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||