|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.sensors.TimeSeries_Int
public class TimeSeries_Int
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. In contrast to the TimeSeries class, this one uses int values for samples, and is thus better suited for resource limited scenarios like J2ME.
| Nested Class Summary | |
|---|---|
static interface |
TimeSeries_Int.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. |
| Field Summary | |
|---|---|
static int |
MAXIMUM_VALUE
|
| Constructor Summary | |
|---|---|
TimeSeries_Int(int windowSize)
Initializes the time series circular buffer with the specified window size. |
|
| Method Summary | |
|---|---|
void |
addNextStageSink(SamplesSink_Int sink)
Registers a sink, which will receive all new values as they are sampled. |
void |
addSample(int sample,
int sampleNum)
Adds a new sample to the time series in-memory buffer, updates statistics and may forward to the next stage. |
int |
getActiveVarianceThreshold()
Gets the current value of activeVarianceThreshold. |
boolean |
getDifferencing()
Gets the current value of differencing. |
int |
getDisivsor()
Gets the current value of divisor. |
int |
getMultiplicator()
Gets the current value of multiplicator. |
int |
getOffset()
Gets the current value of offset. |
int[] |
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. |
int |
getTotalMean()
Returns the mean over all values added to this time series since its construction. |
int |
getTotalVariance()
Returns the variance over all values added to this time series since its construction. |
int |
getWindowMean()
Returns the mean over all values in the time series buffer, i.e. the last window size samples. |
int |
getWindowVariance()
Returns the variance over all values in the time series buffer, i.e. the last window size samples. |
boolean |
removeSink(SamplesSink_Int 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_Int.segmentEnd. |
void |
segmentStart(int indexNotUsed)
Dummy implementation of SamplesSink_Int.segmentStart. |
void |
setActiveVarianceThreshold(int activeVarianceThreshold)
Sets the current value of activeVarianceThreshold. |
void |
setDifferencing(boolean differencing)
Sets the current value of differencing. |
void |
setDivisor(int divisor)
Sets the current value of divisor. |
void |
setMultiplicator(int multiplicator)
Sets the current value of multiplicator. |
void |
setOffset(int offset)
Sets the current value of offset. |
void |
setParameters(TimeSeries_Int.Parameters pars)
Sets the multiplicator, divisor, 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 |
| Field Detail |
|---|
public static final int MAXIMUM_VALUE
| Constructor Detail |
|---|
public TimeSeries_Int(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(int sample,
int sampleNum)
addSample in interface SamplesSink_Intsample - 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 SamplesSink_IntindexNotUsed - The index at which the active segment starts.public void segmentEnd(int indexNotUsed)
segmentEnd in interface SamplesSink_IntindexNotUsed - The index at which the active segment ends.public void addNextStageSink(SamplesSink_Int sink)
sink - The sink to push new pre-processed samples to.public boolean removeSink(SamplesSink_Int sink)
sink - The sink to stop pushing samples to.
public int getTotalMean()
public int getTotalVariance()
public int getWindowMean()
public int getWindowVariance()
public int[] getSamplesInWindow()
public int getOffset()
offsetpublic void setOffset(int offset)
offset - The current value of offset.offsetpublic int getMultiplicator()
multiplicatorpublic void setMultiplicator(int multiplicator)
multiplicator - The current value of multiplicator.multiplicatorpublic int getDisivsor()
divisorpublic void setDivisor(int divisor)
multiplicator - The current value of divisor.divisorpublic 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 int getActiveVarianceThreshold()
activeVarianceThresholdpublic void setActiveVarianceThreshold(int activeVarianceThreshold)
activeVarianceThreshold - The current value of activeVarianceThreshold.activeVarianceThresholdpublic void setParameters(TimeSeries_Int.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 | ||||||||