We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e048ad5 commit 6fdd7aaCopy full SHA for 6fdd7aa
1 file changed
pygad/utils/engine.py
@@ -572,6 +572,11 @@ def run(self):
572
# Set 'call_on_parents=False' to avoid calling the callable 'on_parents' because this step is not part of the cycle.
573
self.run_select_parents(call_on_parents=False)
574
575
+ # Update the elitism according to the 'last_generation_fitness' attribute.
576
+ if self.keep_elitism > 0:
577
+ self.last_generation_elitism, self.last_generation_elitism_indices = self.steady_state_selection(self.last_generation_fitness,
578
+ num_parents=self.keep_elitism)
579
+
580
# Save the fitness value of the best solution.
581
_, best_solution_fitness, _ = self.best_solution(
582
pop_fitness=self.last_generation_fitness)
0 commit comments