mirror of https://github.com/Kkevsterrr/geneva
Fixed bug that caused population to shrink in some cases
Population would shrink when --elite-clones was used; fixed.
This commit is contained in:
parent
36d3585545
commit
2fc5b2f2f4
|
@ -575,7 +575,7 @@ def genetic_solve(logger, options, ga_evaluator):
|
||||||
best_ind.environment_id, str(best_fit), str(best_ind))
|
best_ind.environment_id, str(best_fit), str(best_ind))
|
||||||
|
|
||||||
# Select next generation
|
# 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
|
# Add the elite clones
|
||||||
if options["elite_clones"] > 0:
|
if options["elite_clones"] > 0:
|
||||||
|
|
Loading…
Reference in New Issue