def __init__(self, unit=None, size=DEFAULT_SIZE,
                 alpha=DEFAULT_ALPHA):
        """Create a new exponentially-decaying random reservoir.

        :param size: the number of samples to keep in the sampling reservoir
        :param alpha: the exponential decay factor; the higher this is, the
            more biased the reservoir will be towards newer values.
        """

        self.unit = unit
        self.size = size
        self.alpha = alpha
        self.start_time = self.current_time_in_fractional_seconds()
        self.next_scale_time = self.start_time + RESCALE_THRESHOLD_S
        self.values = treap.treap()
def __init__ ( self , unit = None , size = DEFAULT_SIZE , alpha = DEFAULT_ALPHA ) : self . unit = unit self . size = size self . alpha = alpha self . start_time = self . current_time_in_fractional_seconds ( ) self . next_scale_time = self . start_time + RESCALE_THRESHOLD_S self . values = treap . treap ( )
Create a new exponentially-decaying random reservoir.

        :param size: the number of samples to keep in the sampling reservoir
        :param alpha: the exponential decay factor; the higher this is, the
            more biased the reservoir will be towards newer values.