65 std::vector<IndividualType> & population,
66 RealMatrix
const & referenceVectors,
67 RealVector
const & gammas,
68 std::size_t
const curIteration)
70 if(population.empty())
75 SIZE_CHECK(fitness.size2() == referenceVectors.size2());
76 const std::size_t groupCount = referenceVectors.size1();
79 const RealVector minFitness =
minCol(fitness);
81 fitness -= repeat(minFitness, fitness.size1());
85 const RealMatrix cosA =
cosAngles(fitness, referenceVectors);
86 const RealMatrix angles = acos(cosA);
91 for(
auto & p : population)
95 const double theta = fitness.size2()
96 * std::pow(
static_cast<double>(curIteration) /
99 for(std::size_t j = 0; j < groupCount; ++j)
101 if(subGroups[j].size() == 0)
105 std::size_t selected_idx = 0;
107 for(std::size_t i : subGroups[j])
110 double apd = 1 + theta * angles(i, j) / gammas[j];
111 apd *= norm_2(row(fitness, i));
118 population[selected_idx].selected() =
true;
145 std::vector<IndividualType>
const & population)
147 RealMatrix fitness(population.size(),
148 population[0].unpenalizedFitness().size());
149 for(std::size_t i = 0; i < population.size(); ++i)
151 row(fitness, i) = population[i].unpenalizedFitness();