Non-empty array of objects to choose from.
Name of the numeric weight property on each
object. Defaults to 'probability'.
Optionalrng: JssmRng
Optional random number generator () => number
in [0, 1). Defaults to Math.random.
One element from options, chosen by weighted random selection.
Selects a single item from a weighted array of objects using cumulative probability. Each object in the array should have a numeric property indicating its relative weight (defaults to
'probability'). Objects missing the property are treated as weight 1.