pub fn rate<E, F>(self, evaluator: &E) -> RatedPopulation<I, F>
        where E: Evaluator<I, F>,
              F: PartialOrd
    {
        let len = self.population.len();
        let rated_population: Vec<(I, F)> = self.population
                                                .into_iter()
                                                .map(|ind| {
                                                    let fitness = evaluator.fitness(&ind);
                                                    (ind, fitness)
                                                })
                                                .collect();
        debug_assert!(rated_population.len() == len);
        RatedPopulation { rated_population: rated_population }
    }
/// Evaluates the whole population, i.e. determines the fitness of
/// each `individual` (unless already calculated).
/// Returns the rated population.
Evaluates the whole population, i.e. determines the fitness of
each `individual` (unless already calculated).
Returns the rated population.
Evaluates the whole population i . e . determines the fitness of each ` individual ` ( unless already calculated ) . Returns the rated population .
pub fn rate<E, F>(self, evaluator: &E) -> RatedPopulation<I, F>
        where E: Evaluator<I, F>,
              F: PartialOrd
    {
        let len = self.population.len();
        let rated_population: Vec<(I, F)> = self.population
                                                .into_iter()
                                                .map(|ind| {
                                                    let fitness = evaluator.fitness(&ind);
                                                    (ind, fitness)
                                                })
                                                .collect();
        debug_assert!(rated_population.len() == len);
        RatedPopulation { rated_population: rated_population }
    }
pub fn rate < E , F > ( self , evaluator : & E ) -> RatedPopulation < I , F > where E : Evaluator < I , F > , F : PartialOrd { let len = self . population . len ( ) ; let rated_population : Vec < ( I , F ) > = self . population . into_iter ( ) . map ( | ind | { let fitness = evaluator . fitness ( & ind ) ; ( ind , fitness ) } ) . collect ( ) ; debug_assert ! ( rated_population len ( ) len ) ; RatedPopulation { rated_population : rated_population } }
Evaluates the whole population, i.e.
Evaluates the whole population i . e .
self
evaluator
&E