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

Commit 087d894

Browse files
author
Theodoros Theodoridis
committed
[genetic search] Fix bug that disabled crossover
1 parent d068408 commit 087d894

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
@@ -256,9 +256,9 @@ void GeneticSearch::breed() {
256256
auto accFitness = computeAccumulatedFitness(population);
257257
Population new_population;
258258
new_population.reserve(maxPopulationSize);
259-
for (auto& p : population) {
259+
for (size_t c = 0; c < numberElites; ++c) {
260260
new_population.push_back(
261-
make_unique<CandidateConfiguration>(p->configuration));
261+
make_unique<CandidateConfiguration>(population.at(c)->configuration));
262262
}
263263

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

0 commit comments

Comments
 (0)