Skip to main content

weighted_select

Function weighted_select 

Source
pub fn weighted_select<'a, T, R: Rng>(
    rng: &mut R,
    options: &'a [(T, f64)],
) -> &'a T
Expand description

Select from weighted options. Weights don’t need to sum to 1.0.