(self, val)
Integrates the new value.
Integrates the new value.
Integrates the new value .
def value(self, val):
    """Integrates the new value."""
    self._value_acc += val
    self._num_samples += 1

    time_elapsed = time.time() - self._sampling_timestamp
    if time_elapsed >= self._refresh_rate:
      self._value = self._value_acc / self._num_samples
      self._value_acc = 0
      self._num_samples = 0
      self._sampling_timestamp = time.time()
def value ( self , val ) : self . _value_acc += val self . _num_samples += 1 time_elapsed = time . time ( ) - self . _sampling_timestamp if time_elapsed >= self . _refresh_rate : self . _value = self . _value_acc / self . _num_samples self . _value_acc = 0 self . _num_samples = 0 self . _sampling_timestamp = time . time ( )