SumQueue

scalation.modeling.SumQueue
class SumQueue(q: Int)

The SumQueue class retains the last q elements as well as the running total in sum and number of elements in size_, making it efficient to compute moving averages.

Value parameters

q

the number of elements to retain in the queue

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def +=(y: Double): Unit

Enqueue the next element y in the queue, removing the first element when the queue is full.

Enqueue the next element y in the queue, removing the first element when the queue is full.

Value parameters

y

the next element to place in the queue

Attributes

def mean: Double

Return the mean of the elements in the queue.

Return the mean of the elements in the queue.

Attributes

def size: Int

Return the size (number of elements) in the queue.

Return the size (number of elements) in the queue.

Attributes