The type of the outcome generated from this random device.
Constructor for a random device.
An array of (outcome, odds) pairs.
Get the possible outcomes and odds for this random device.
The possible outcomes (as sets) this random device can generate along with the odds of each outcome.
Generated using TypeDoc
A device generating random outcomes with specific odds. For example, a classic 6-sided can be created with the following code:
const d6 = new RandomDevice<number>([ [1, new Fraction(1, 6)], [2, new Fraction(1, 6)], [3, new Fraction(1, 6)], [4, new Fraction(1, 6)], [5, new Fraction(1, 6)], [6, new Fraction(1, 6)] ]);