Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit d23898e

Browse files
Theodoros Theodoridisnicolasvasilache
authored andcommitted
[genetic search] Fix bug that disabled crossover
1 parent 446b19b commit d23898e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tc/autotuner/genetic_search.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ void GeneticSearch::breed() {
258258
auto accFitness = computeAccumulatedFitness(population);
259259
Population new_population;
260260
new_population.reserve(maxPopulationSize);
261-
for (auto& p : population) {
261+
for (size_t c = 0; c < numberElites; ++c) {
262262
new_population.push_back(
263-
make_unique<CandidateConfiguration>(p->configuration));
263+
make_unique<CandidateConfiguration>(population.at(c)->configuration));
264264
}
265265

266266
auto select = [&]() -> const TuningConfiguration& {

0 commit comments

Comments
 (0)