Returns whether we are in a run.
Returns whether we are in a run.
true when sum / q.size >= idle_thresh
and q.size >= windowLength
.
Returns the internal queue.
Returns the internal queue.
a Queue of data items that are part of the beginning of the current run.
Returns true when values from spark.timeseries.TimeSeriesSpark.IdleArrayDetector.inRun() can be trusted.
Returns true when values from spark.timeseries.TimeSeriesSpark.IdleArrayDetector.inRun() can be trusted.
true when readyDelay == 0
and q.size >= windowLength
Resets the internal queue and sum, along with readyDelay.
Resets the internal queue and sum, along with readyDelay.
Call to inform the detector of proceeding to a new split.
Call to inform the detector of proceeding to a new split.
Sets readyDelay
to windowLength
so that windowLength
samples are put into the queue
before ready()
returns true again. This is to ensure that a run in the beginning of a
next split will be detected.
Appends sample
to the internal queue and updates sum
.
Appends sample
to the internal queue and updates sum
.
Also dequeues the first element if the queue if the queue is full,
and decreases readyDelay
by one if it is greater than zero.
Detect periods of activity from a data file of scala.Arrays of scala.Doubles, where each scala.Array consists of time, current, and voltage values.
Detection of activity is based on the average power (in mW) being above a given threshold
idle_thresh
. The average is calculated over a period ofwindowLength
Arrays.