pub fn update(&mut self, odds : f64, value : T) -> Option<T> {
        self.counter += odds;
        if self.rng.next_f64() * self.counter < odds {
            mem::replace(&mut self.value, Some(value))
        }
        else {
            Some(value)
        }
    }
/// Update the selector, replacing the original value with a new value with
/// a probability p/sum(p)
Update the selector, replacing the original value with a new value with
a probability p/sum(p)
Update the selector replacing the original value with a new value with a probability p / sum ( p )
pub fn update(&mut self, odds : f64, value : T) -> Option<T> {
        self.counter += odds;
        if self.rng.next_f64() * self.counter < odds {
            mem::replace(&mut self.value, Some(value))
        }
        else {
            Some(value)
        }
    }
pub fn update ( & mut self , odds : f64 , value : T ) -> Option < T > { self . counter += odds ; if self . rng . next_f64 ( ) * self . counter < odds { mem :: replace ( & mut self . value , Some ( value ) ) } else { Some ( value ) } }
Update the selector, replacing the original value with a new value with
a probability p/sum(p)
Update the selector replacing the original value with a new value with a probability p / sum ( p )
&mut self
odds
f64
value
T
&mut self
odds
f64
value
T