ganesh

Trait RandChoice

Source
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§

Source

fn choice_weighted(&mut self, weights: &[Float]) -> Option<usize>

Return an random index sampled with the given weights

Implementations on Foreign Types§

Source§

impl RandChoice for Rng

Source§

fn choice_weighted(&mut self, weights: &[Float]) -> Option<usize>

Implementors§