fn kill_off(&mut self, count: usize) {
        let ratio = self.population.len() / count;
        let mut i = ::rand::thread_rng().gen_range::<usize>(0, self.population.len());
        for _ in 0..count {
            self.population.swap_remove(i);
            i += ratio;
            i %= self.population.len();
        }
    }
/// Kill off phenotypes using stochastic universal sampling.
Kill off phenotypes using stochastic universal sampling.
Kill off phenotypes using stochastic universal sampling .
fn kill_off(&mut self, count: usize) {
        let ratio = self.population.len() / count;
        let mut i = ::rand::thread_rng().gen_range::<usize>(0, self.population.len());
        for _ in 0..count {
            self.population.swap_remove(i);
            i += ratio;
            i %= self.population.len();
        }
    }
fn kill_off ( & mut self , count : usize ) { let ratio = self . population . len ( ) / count ; let mut i = :: rand :: thread_rng ( ) . gen_range :: < usize > ( 0 , self . population . len ( ) ) ; for _ in 0 .. count { self . population . swap_remove ( i ) ; i += ratio ; i %= self . population . len ( ) ; } }
Kill off phenotypes using stochastic universal sampling.
Kill off phenotypes using stochastic universal sampling .
&mut self
count
usize