From 2fc5b2f2f4766278902cff25af50b753d1d26a76 Mon Sep 17 00:00:00 2001 From: Kevin Bock Date: Fri, 28 Jan 2022 15:20:10 -0500 Subject: [PATCH] Fixed bug that caused population to shrink in some cases Population would shrink when --elite-clones was used; fixed. --- evolve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evolve.py b/evolve.py index 653bacc..fe270ca 100644 --- a/evolve.py +++ b/evolve.py @@ -575,7 +575,7 @@ def genetic_solve(logger, options, ga_evaluator): best_ind.environment_id, str(best_fit), str(best_ind)) # Select next generation - population = selection_tournament(offspring, k=len(population) - options["elite_clones"], tournsize=10) + population = selection_tournament(offspring, k=len(offspring) - options["elite_clones"], tournsize=10) # Add the elite clones if options["elite_clones"] > 0: