|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.sensors.TimeSeriesBundle
public abstract class TimeSeriesBundle
This class implements a collection of multiple time series that belong together, for example multiple dimensions from a single sensor. It keeps the time series of the first step, i.e. the pre-processing that does a linear transformation to [-1;1] and detects active/quiescent segments, internally. Using the getSinks() method, these internally managed TimeSeries objects can be registered with the samples source. After an active segment ends, this class emits the aggregated segment.
| Field Summary | |
|---|---|
protected int |
curActiveSegmentLength
Holds the number of sample in the current active segment or -1 if no line is active at the moment. |
protected double[] |
curSample
This is just a buffer to keep the current sample dimension until all dimensions have been received and can thus be aggregated into a new value appended to aggregatedSeries. |
protected int[] |
curSample_Int
And the integer version. |
protected int |
curSampleIndex
Holds the index of the last complete sample that has been received. |
protected boolean[] |
curSampleReceived
Used to mark the sample dimensions that have already been received. |
protected org.openuat.sensors.TimeSeriesBundle.TimeSeriesSinks |
firstStageHandlers
Holds the TimeSeriesSink objects that are registered as sinks with the firstStageSeries objects. |
protected TimeSeries[] |
firstStageSeries
These are the time series for the first stage. |
protected TimeSeries_Int[] |
firstStageSeries_Int
And the integer version. |
protected int |
maxSegmentSize
The maximum segment size to use, as passed to the constructor. |
protected int |
minSegmentSize
The minimum segment size to use, as passed to the constructor. |
protected java.util.Vector |
samplesSinks
Holds all registered sinks that should receive active, aggregated samples. |
protected java.util.Vector |
samplesSinks_Int
|
protected java.util.Vector |
segmentsSinks
Holds all registered sinks that should receive active, aggregated, completed segments. |
protected java.util.Vector |
segmentsSinks_Int
|
protected int |
windowSize
This window size as passed to the constructor. |
| Constructor Summary | |
|---|---|
protected |
TimeSeriesBundle(int numSeries,
int windowSize,
int minSegmentSize,
int maxSegmentSize)
Constructs all internal buffers and the time series. |
| Method Summary | |
|---|---|
void |
addNextStageSamplesSink(SamplesSink_Int sink)
|
void |
addNextStageSamplesSink(SamplesSink sink)
Registers a sink which will receive all samples within active segments immediately after they have been aggregated into one dimension. |
void |
addNextStageSegmentsSink_Int(SegmentsSink_Int sink)
|
void |
addNextStageSegmentsSink(SegmentsSink sink)
Registers a sink which will receive all active segments when they are complete. |
void |
forceToQuiescent()
This method forces the embedded time series to quiescent and thus the accumulated segment to be sent out. |
SamplesSink_Int[] |
getInitialSinks_Int()
Returns the first stage sink objects that can be registered with the samples source. |
SamplesSink[] |
getInitialSinks()
Returns the first stage sink objects that can be registered with the samples source. |
boolean |
removeNextStageSamplesSink(SamplesSink_Int sink)
|
boolean |
removeNextStageSamplesSink(SamplesSink sink)
Removes a previously registered sink. |
boolean |
removeNextStageSegmentsSink(SegmentsSink_Int sink)
|
boolean |
removeNextStageSegmentsSink(SegmentsSink sink)
Removes a previously registered sink. |
void |
reset()
Resets the time series to the state as created when freshly constructing it. |
protected abstract void |
sampleAddedLine(int lineIndex,
double sample,
int numSample)
|
protected abstract void |
sampleAddedLine(int lineIndex,
int sample,
int numSample)
|
void |
setActiveVarianceThreshold(double activeVarianceThreshold)
Sets the activeVarianceThreshold for all internally kept time series. |
void |
setActiveVarianceThreshold(int activeVarianceThreshold)
|
void |
setMultiplicator(double multiplicator)
Sets the multiplicator for all internally kept time series. |
void |
setMultiplicator(int multiplicator)
|
void |
setOffset(double offset)
Sets the offset for all internally kept time series. |
void |
setOffset(int offset)
|
void |
setParameters(TimeSeries_Int.Parameters pars)
|
void |
setParameters(TimeSeries.Parameters pars)
Sets the parameters for all internally kept time series. |
void |
setSubtractTotalMean(boolean subtractTotalMean)
Sets the subtractTotalMean for all internally kept time series. |
void |
setSubtractWindowMean(boolean subtractWindowMean)
Sets the subtractWindowMean for all internally kept time series. |
protected abstract void |
toActiveFirstLine(int numSample)
|
protected abstract void |
toQuiescentLastLine(int numSample)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TimeSeries[] firstStageSeries
protected TimeSeries_Int[] firstStageSeries_Int
protected org.openuat.sensors.TimeSeriesBundle.TimeSeriesSinks firstStageHandlers
protected double[] curSample
protected int[] curSample_Int
protected boolean[] curSampleReceived
protected int curSampleIndex
protected int windowSize
#TimeSeriesAggregator(int, int, int, int)protected int minSegmentSize
#TimeSeriesAggregator(int, int, int, int)protected int maxSegmentSize
#TimeSeriesAggregator(int, int, int, int)protected java.util.Vector segmentsSinks
protected java.util.Vector segmentsSinks_Int
protected java.util.Vector samplesSinks
protected java.util.Vector samplesSinks_Int
protected int curActiveSegmentLength
| Constructor Detail |
|---|
protected TimeSeriesBundle(int numSeries,
int windowSize,
int minSegmentSize,
int maxSegmentSize)
numSeries - The number of time series to use, i.e. the dimensionality
of the input space.windowSize - The time window size to use for detecting active/quiescent
segments. This is specified as the number of samples in the
window.minSegmentSize - The minimum size of an active segment to be regarded
significant enough to be sent to listeners.maxSegmentSize - If set to something other than -1, specifies the
maximum size of an active segments. If an active segment
is longer than this number of samples, it will be sent
to the listeners as soon as it reaches this length. The
remainders of longer segments will be discarded. Set to
-1 to disable this functionality, otherwise must be
>=minSegmentSize.| Method Detail |
|---|
public void reset()
public SamplesSink[] getInitialSinks()
public SamplesSink_Int[] getInitialSinks_Int()
public void setOffset(double offset)
TimeSeries.setOffset(double)public void setOffset(int offset)
public void setMultiplicator(double multiplicator)
TimeSeries.setMultiplicator(double)public void setMultiplicator(int multiplicator)
public void setSubtractWindowMean(boolean subtractWindowMean)
TimeSeries.setSubtractWindowMean(boolean)public void setSubtractTotalMean(boolean subtractTotalMean)
TimeSeries.setSubtractTotalMean(boolean)public void setActiveVarianceThreshold(double activeVarianceThreshold)
TimeSeries.setActiveVarianceThreshold(double)public void setActiveVarianceThreshold(int activeVarianceThreshold)
public void setParameters(TimeSeries.Parameters pars)
TimeSeries.setParameters(org.openuat.sensors.TimeSeries.Parameters)public void setParameters(TimeSeries_Int.Parameters pars)
public void addNextStageSegmentsSink(SegmentsSink sink)
sink - The sink to push new aggregated segments to.public void addNextStageSegmentsSink_Int(SegmentsSink_Int sink)
public boolean removeNextStageSegmentsSink(SegmentsSink sink)
sink - The sink to stop pushing segments to.
public boolean removeNextStageSegmentsSink(SegmentsSink_Int sink)
public void addNextStageSamplesSink(SamplesSink sink)
sink - The sink to push new aggregated segments to.public void addNextStageSamplesSink(SamplesSink_Int sink)
public boolean removeNextStageSamplesSink(SamplesSink sink)
sink - The sink to stop pushing segments to.
public boolean removeNextStageSamplesSink(SamplesSink_Int sink)
public void forceToQuiescent()
protected abstract void toActiveFirstLine(int numSample)
protected abstract void toQuiescentLastLine(int numSample)
protected abstract void sampleAddedLine(int lineIndex,
double sample,
int numSample)
protected abstract void sampleAddedLine(int lineIndex,
int sample,
int numSample)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||