DiscreteDistribution

The range equivalent of dice, each element of which is the result of the roll of a random die with relative probabilities stored in the range proportions. Each successive value of front reflects the index in proportions that was chosen. If no random number generator is specified, the default rndGen will be used as the source of randomness.

This offers a superior option in the event of making many rolls of the same die, as the sum and CDF of proportions only needs to be calculated upon construction and not with each call.

Constructors

this
this(UniformRNG rng, Range proportions)
Undocumented in source.
this
this(typeof(this) that)
Undocumented in source.

Members

Functions

front
size_t front()
popFront
void popFront()
save
typeof(this) save()

Range primitives

Variables

empty
enum bool empty;

Range primitives

isRandomDistribution
enum bool isRandomDistribution;
Undocumented in source.

Meta