pub fn weighted_sample(weights: &[f64], rng: &mut impl Rng) -> usize
Weighted sampling — draw one index proportional to weights.