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

Commit 39427e5

Browse files
author
Theodoros Theodoridis
committed
[genetic search] Fix bug that disabled crossover
1 parent 4d83379 commit 39427e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/autotuner/genetic_search.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ void GeneticSearch::breed() {
250250
auto accFitness = computeAccumulatedFitness(population);
251251
Population new_population;
252252
new_population.reserve(kMaxPopulationSize);
253-
for (auto& p : population) {
253+
for (size_t c = 0; c < kNumberElites; ++c) {
254254
new_population.push_back(
255-
make_unique<CandidateConfiguration>(p->configuration));
255+
make_unique<CandidateConfiguration>(population.at(c)->configuration));
256256
}
257257

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

0 commit comments

Comments
 (0)