updateEstimation method

void updateEstimation(
  1. double totalExtent,
  2. int count
)
inherited

average _averageExtentForEachIndex based on the current observed totalExtent, maybe we should have a better way to summarize the previous estimation: _averageExtentForEachIndex and the current exact extent: totalExtent

Implementation

void updateEstimation(double totalExtent, int count) {
  final average = count == 0 ? totalExtent : totalExtent / count;

  if (_averageExtentForEachIndex == 0) {
    _averageExtentForEachIndex = average;
  } else {
    _averageExtentForEachIndex = (average + _averageExtentForEachIndex) / 2;
  }
}