78 InIterator individuals,
79 InIterator individualsE,
85 std::size_t size = std::distance( individuals, individualsE );
86 std::vector<InIterator> sortedIndividuals(size);
87 std::iota(sortedIndividuals.begin(),sortedIndividuals.end(),individuals);
89 sortedIndividuals.begin(),
90 sortedIndividuals.end(),
91 [](InIterator lhs, InIterator rhs){
93 return ordering(*lhs,*rhs);
97 RealVector selectionProbability(size);
98 double a = 2. * (
etaMax - 1.)/(size - 1.);
99 for( std::size_t i = 0; i != size; ++i ) {
100 selectionProbability[i] = (
etaMax - a*i);
102 selectionProbability /=sum(selectionProbability);
105 for( ; out != outE; ++out ){
106 InIterator individuals = rws(rng, sortedIndividuals.begin(), sortedIndividuals.end(), selectionProbability)->value;