Closed abey79 closed 8 months ago
This PR adds to functions to whiskers::Context:
whiskers::Context
ctx.rng_weighted_bool(prob: f64)
true
ctx.rng_ratio_bool(num: u32, denim: u32)
num/denom
The latter variant is useful for when dealing with, e.g., column or row index:
let some_bool = ctx.rng_ratio_bool(current_columns, (total_column - 1));
This PR adds to functions to
whiskers::Context
:ctx.rng_weighted_bool(prob: f64)
: random bool with give probability oftrue
ctx.rng_ratio_bool(num: u32, denim: u32)
: same, but with probability expressed as anum/denom
ratioThe latter variant is useful for when dealing with, e.g., column or row index: