pyuutils.base.random
RandomGenerator
- class pyuutils.base.random.RandomGenerator[source]
A wrapper class for RandomGenerator to provide a more Pythonic interface.
- arcsine(minv: float, maxv: float) float[source]
Generate a random double following an arcsine distribution.
- Parameters:
minv (float) – Minimum value
maxv (float) – Maximum value
- Returns:
Random double
- Return type:
float
- beta(alpha: float, beta: float) float[source]
Generate a random double following a beta distribution.
- Parameters:
alpha (float) – Alpha parameter
beta (float) – Beta parameter
- Returns:
Random double
- Return type:
float
- exp(rate: float) float[source]
Generate a random double following an exponential distribution.
- Parameters:
rate (float) – Rate parameter
- Returns:
Random double
- Return type:
float
- gamma(shape: float, scale: float) float[source]
Generate a random double following a gamma distribution.
- Parameters:
shape (float) – Shape parameter
scale (float) – Scale parameter
- Returns:
Random double
- Return type:
float
- normal(mean: float, stddev: float) float[source]
Generate a random double following a normal distribution.
- Parameters:
mean (float) – Mean value
stddev (float) – Standard deviation
- Returns:
Random double
- Return type:
float
- poisson(mean: float) float[source]
Generate a random double following a Poisson distribution.
- Parameters:
mean (float) – Mean value
- Returns:
Random double
- Return type:
float
- seed(seed: int)[source]
Set random seed for this generator instance.
- Parameters:
seed (int) – Seed value
- static set_seed(seed: int)[source]
Set globally shared random seed.
- Parameters:
seed (int) – Seed value
- tri(lower: float, mode: float, upper: float) float[source]
Generate a random double following a triangular distribution.
- Parameters:
lower (float) – Lower bound
mode (float) – Mode value
upper (float) – Upper bound
- Returns:
Random double
- Return type:
float
- uni(*args) int[source]
Generate a random integer based on provided arguments.
- Parameters:
args – Arguments for the uniform distribution
- Returns:
Random integer
- Return type:
int
- uni_1() float[source]
Generate a random double in the range [0, 1).
- Returns:
Random double
- Return type:
float