Alarm Clock¶
—
Base Class
The abstract base class for all alarm clocks is defined below.
—
Poisson Alarm Clock
An alarm clock where inter-revision times are independently sampled from an exponential distribution.
- class popgames.alarm_clock.Poisson(rate=1.0)[source]¶
Bases:
AlarmClockABC
Poisson alarm clock.
Initialize the Poisson alarm clock.
- Parameters:
rate (float) – The rate of the alarm clock. Defaults to 1.0.
- __call__(size)[source]¶
Call the Poisson alarm clock.
- Parameters:
size (int) – Number of samples to retrieve from the clock.
- Returns:
The revision times.
- Return type:
Union[float, np.ndarray]
Examples
>>> from popgames.alarm_clock import Poisson >>> clock = Poisson(rate=1.0) >>> clock(3) array([2.34438986, 0.53956626, 0.80216914])