[][src]Module genevo::random

The random module defines functions that are used to generate random values for specific purposes.

Structs

Open01

A distribution to sample floating point numbers uniformly in the open interval (0, 1), i.e. not including either endpoint.

WeightedDistribution

The WeightedDistribution is used to select values proportional to their weighted values.

Traits

Rng

An automatically-implemented extension trait on [RngCore] providing high-level generic methods for sampling values and other convenience methods.

SampleUniform

Helper trait for creating objects using the correct implementation of [UniformSampler] for the sampling type.

SeedableRng

A random number generator that can be explicitly seeded.

SliceRandom

Extension trait on slices, providing random mutation and sampling methods.

Functions

get_rng

Returns a new Prng initialized with the given seed.

random_cut_points

Generates two cut points for a slice of given length using the given Prng. The first of the two returned cut points is always smaller than the second one.

random_cut_points_from_range

Generates two cut points within the given range using the given Prng. The first of the two returned cut points is always smaller than the second one.

random_index

Generates a random index into a slice of given length using the given Prng.

random_index_from_range

Generates a random index in the given range using the given Prng.

random_n_cut_points

Generates n cut points for a slice of given length using the given Prng. The returned cut points are ordered in ascending order.

random_probability

Generates a random probability between 0 and 1 using the given Prng.

random_seed

Generates a random seed to initialize the Prng.

Type Definitions

Prng

The Prng is the pseudo random number generator used through out this library.

Seed

The Seed as used through out this library to seed the Prng.