python/src/rwsims/distributions.py

17 lines
434 B
Python
Raw Normal View History

2024-06-19 17:10:49 +00:00
from __future__ import annotations
from numpy.typing import ArrayLike
from numpy.random import Generator
class DeltaDistribution:
def __init__(self, tau: float, rng: Generator | None = None):
self._tau = tau
self._rng = rng
def __repr__(self):
return f'DeltaDistribution (tau={self._tau})'
def wait(self, size: int = 1) -> ArrayLike:
return self._rng.exponential(self._tau, size=size)