pub trait RandChoice {
// Required method
fn choice_weighted(&mut self, weights: &[Float]) -> Option<usize>;
}Expand description
A helper trait to provide a weighted random choice method
Required Methods§
Sourcefn choice_weighted(&mut self, weights: &[Float]) -> Option<usize>
fn choice_weighted(&mut self, weights: &[Float]) -> Option<usize>
Return an random index sampled with the given weights