MovingAverage<T> constructor

MovingAverage<T>({
  1. AverageType averageType = AverageType.simple,
  2. int windowSize = 1,
  3. bool partialStart = false,
  4. double factor = 1.0,
  5. required num getValue(
    1. T
    ),
  6. required T add(
    1. List<T> data,
    2. num newValue
    ),
})

Instantiate the class with the given parameters

If averageType is AverageType.simple or AverageType.weighted then factor is ignored.

If averageType is AverageType.exponential then windowSize and partialStart are ignored.

Implementation

MovingAverage({
  this.averageType = AverageType.simple,
  this.windowSize = 1,
  this.partialStart = false,
  this.factor = 1.0,
  required this.getValue,
  required this.add,
});