Recalculate stats objects.
@return void
161645
public function recalculateStats()
	{
		if (empty($this->stats)) {
			$this->stats = new Stats();
		}

		$this->stats->reset();

		if (empty($this->points)) {
			return;
		}

		$pointCount = count($this->points);

		$firstPoint = &$this->points[0];
		$lastPoint = end($this->points);

		$this->stats->startedAt = $firstPoint->time;
		$this->stats->finishedAt = $lastPoint->time;
		$this->stats->minAltitude = $firstPoint->elevation;

		list($this->stats->cumulativeElevationGain, $this->stats->cumulativeElevationLoss) =
			ElevationGainLossCalculator::calculate($this->getPoints());

		$this->stats->distance = DistanceCalculator::calculate($this->getPoints());

		for ($p = 0; $p < $pointCount; $p++) {
			if ((phpGPX::$IGNORE_ELEVATION_0 === false || $this->points[$p]->elevation > 0) && $this->stats->minAltitude > $this->points[$p]->elevation) {
				$this->stats->minAltitude = $this->points[$p]->elevation;
			}

			if ($this->stats->maxAltitude < $this->points[$p]->elevation) {
				$this->stats->maxAltitude = $this->points[$p]->elevation;
			}

			if ($this->stats->minAltitude > $this->points[$p]->elevation) {
				$this->stats->minAltitude = $this->points[$p]->elevation;
			}
		}

		if (($firstPoint->time instanceof \DateTime) && ($lastPoint->time instanceof \DateTime)) {
			$this->stats->duration = $lastPoint->time->getTimestamp() - $firstPoint->time->getTimestamp();

			if ($this->stats->duration != 0) {
				$this->stats->averageSpeed = $this->stats->distance / $this->stats->duration;
			}

			if ($this->stats->distance != 0) {
				$this->stats->averagePace = $this->stats->duration / ($this->stats->distance / 1000);
			}
		}
	}
42206
public function computeStats()
    {
        $this->rejects = [];
        $revs = $this->getRevolutions();

        if (0 === count($this->iterations)) {
            return;
        }

        $times = $this->getMetricValuesByRev(TimeResult::class, 'net');
        $retryThreshold = $this->getSubject()->getRetryThreshold();

        $this->stats = new Distribution($times, $this->computedStats);

        foreach ($this->iterations as $iteration) {
            $timeResult = $iteration->getResult(TimeResult::class);
            assert($timeResult instanceof TimeResult);
            // deviation is the percentage different of the value from the mean of the set.
            if ($this->stats->getMean() > 0) {
                $deviation = 100 / $this->stats->getMean() * (
                    (
                        $timeResult->getRevTime($iteration->getVariant()->getRevolutions())
                    ) - $this->stats->getMean()
                );
            } else {
                $deviation = 0;
            }

            // the Z-Value represents the number of standard deviations this
            // value is away from the mean.
            $revTime = $timeResult->getRevTime($revs);
            $zValue = $this->stats->getStdev() ? ($revTime - $this->stats->getMean()) / $this->stats->getStdev() : 0;

            if (null !== $retryThreshold) {
                if (abs($deviation) >= $retryThreshold) {
                    $this->rejects[] = $iteration;
                }
            }

            $iteration->setResult(new ComputedResult($zValue, $deviation));
        }

        $this->computed = true;
    }
290185
def reset_stats(self):
        
        scores = list(itertools.chain.from_iterable([v.total_scores for v in self._runners]))
        for v in self._runners:
            v.total_scores.clear()

        try:
            return np.mean(scores), np.max(scores)
        except Exception:
            logger.exception("Cannot compute total scores in EnvRunner.")
            return None, None
1291279
def do_counter_conversion(self):
        """"""
        if self.is_counter:
            if self._previous_counter_value is None:
                prev_value = self.latest_value
            else:
                prev_value = self._previous_counter_value
            self._previous_counter_value = self.latest_value
            self.latest_value = self.latest_value - prev_value
172167
public function calculateChangeSet()
    {
        $set = [];
        foreach ($this->current as $key => $current) {
            $original = isset($this->original[$key]) ? $this->original[$key] : null;
            $set[$key]['old'] = $original;
            $set[$key]['new'] = $current;
        }
        foreach ($this->remove as $key) {
            $set[$key]['old'] = $this->original[$key];
            $set[$key]['new'] = null;
        }
        ksort($set);
        return $set;
    }
239832
protected function calcRelativeValues()
    {
        foreach ($this->stackLog as $key => $value) {
            foreach ($this->metrics as $metric) {
                foreach (array('own', 'sub', 'total') as $column) {
                    if (!isset($this->stackLog[$key][$metric . '_' . $column])) {
                        continue;
                    }
                    $this->stackLog[$key][$metric . '_rel_' . $column] = $this->stackLog[$key][$metric . '_' . $column] / $this->stackLog['timetracker_0'][$metric . '_total'];
                }
                $this->stackLog[$key][$metric . '_rel_offset'] = $this->stackLog[$key][$metric . '_start_relative'] / $this->stackLog['timetracker_0'][$metric . '_total'];
            }
        }
    }
1317807
public function reload()
    {
        $id = $this->getRecordIdent();
        $this->dataReset();
        $this->loadFromFlexiBee($id);
        return $this->lastResponseCode == 200;
    }
1022119
@Override
	public void resetStats() {
		smoothedSum = 0.0;
		smoothedSqr = 0.0;
		smoothedCount = 0.0;
		smoothedMin = 0.0;
		smoothedMax = 0.0;

		lastMaxInteger = Integer.MIN_VALUE;
		lastMinInteger = Integer.MAX_VALUE;
		lastSumInteger = 0;
		lastSqrInteger = 0;
		lastCountInteger = 0;
		lastValueInteger = 0;

		lastMaxDouble = -Double.MAX_VALUE;
		lastMinDouble = Double.MAX_VALUE;
		lastSumDouble = 0.0;
		lastSqrDouble = 0.0;
		lastCountDouble = 0;
		lastValueDouble = 0.0;

		lastTimestampMillis = 0L;
		smoothedRate = 0;
		smoothedTimeSeconds = 0;

		totalSum = 0.0;
		totalCount = 0;

		if (histogramLevels != null) {
			for (int i = 0; i < histogramValues.length; i++) {
				histogramValues[i] = 0;
			}
		}
	}
220998
public function reset()
    {
        $this->numRequests  = 0;
        $this->numProcessed = 0;

        $this->currItem                 = null;
        $this->resumptionToken          = null;
        $this->totalRecordsInCollection = null;
        $this->expireDate               = null;

        $this->batch = [];
    }
194429
public function rewind()
    {
        $this->subPriorities = $this->priorities;
        $this->maxPriority   = empty($this->priorities) ? 0 : max($this->priorities);
        $this->index         = 0;
        $this->subIndex      = 0;
    }
33551
def recalculate_satistics(self):
        '''
        
        '''
        gframe = wx.BusyInfo(
            "Re-calculating statistics for all specimens\n Please wait..", self)

        for specimen in list(self.Data.keys()):
            if 'pars' not in list(self.Data[specimen].keys()):
                continue
            if 'specimen_int_uT' not in list(self.Data[specimen]['pars'].keys()):
                continue
            tmin = self.Data[specimen]['pars']['measurement_step_min']
            tmax = self.Data[specimen]['pars']['measurement_step_max']
            pars = thellier_gui_lib.get_PI_parameters(
                self.Data, self.acceptance_criteria, self.preferences, specimen, tmin, tmax, self.GUI_log, THERMAL, MICROWAVE)
            self.Data[specimen]['pars'] = pars
            self.Data[specimen]['pars']['lab_dc_field'] = self.Data[specimen]['lab_dc_field']
            self.Data[specimen]['pars']['er_specimen_name'] = self.Data[specimen]['er_specimen_name']
            self.Data[specimen]['pars']['er_sample_name'] = self.Data[specimen]['er_sample_name']
        del gframe
57892
public final function reset(): void
    {
        // reset data
        $this->data = [];
        // reset properties
        $this->ids = [];
        $this->rowsCount = 0;
        $this->rowsAffected = 0;
    }
14031
public void reset() {
    statsComputed.set(false);
    pos = 0;
    curSize = 0;
    total = 0L;
    mean = 0.0;
    variance = 0.0;
    stddev = 0.0;
    min = 0L;
    max = 0L;
    for (int i = 0; i < percentileValues.length; ++i) {
      percentileValues[i] = 0.0;
    }
  }
1258267
public function recalculate_width()
    {
        $width = 0;

        foreach ($this->get_frames() as $frame) {
            $width += $frame->calculate_auto_width();
        }

        return $this->w = $width;
    }
335711
public function calculateDiscount()
    {
        $dPrice = $this->getPrice();
        $aDiscounts = $this->getDiscounts();

        if ($aDiscounts) {
            foreach ($aDiscounts as $aDiscount) {
                if ($aDiscount['type'] == 'abs') {
                    $dPrice = $dPrice - $aDiscount['value'];
                } else {
                    $dPrice = $dPrice * (100 - $aDiscount['value']) / 100;
                }
            }
            if ($dPrice < 0) {
                $this->setPrice(0);
            } else {
                $this->setPrice($dPrice);
            }

            $this->_flushDiscounts();
        }
    }
436582
public function recalculateRatings()
    {
        // Compute rating value.
        // @todo Need to know weather comments has changed or not.
        // Unfortunately, persistent collection gets no dirty flag,
        // if existing entries are changed....
        // We limit recalculates to the cases where comments gets loaded from
        // the database (which still does not neccessarly mean, there are changes...

        $comments = $this->getComments();
        if ($comments instanceof ArrayCollection // new Comments
            || $comments->isInitialized() // Comments were loaded and eventually changed (we do not know)
            || $comments->isDirty() // new Comments added w/o initializing
        ) {
            $this->getRating(/*recalculate*/ true);
        }
    }
506750
public function reset()
    {
        $this->values[self::ID] = null;
        $this->values[self::PUBLICKEY] = null;
        $this->values[self::PRIVATEKEY] = null;
        $this->values[self::SIGNATURE] = null;
        $this->values[self::TIMESTAMP] = null;
    }