Skip to content

Commit

Permalink
Fixed bug that caused population to shrink in some cases
Browse files Browse the repository at this point in the history
Population would shrink when --elite-clones was used; fixed.
  • Loading branch information
Kkevsterrr authored Jan 28, 2022
1 parent 36d3585 commit 2fc5b2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2fc5b2f

Please sign in to comment.