Fixed population creation

This commit is contained in:
danielwilczak101
2020-10-12 23:18:46 -04:00
parent 50e7166ea5
commit 67f5133171

View File

@ -5,4 +5,4 @@ class Survivor_Selection:
def fill_in_best(ga, next_population):
"""Fills in the next population with the best chromosomes from the last population until the population size is met."""
return Population(ga.population.get_all_chromosomes()[:ga.population.size()-next_population.size()] + next_population.get_all_chromosomes())
return ga.make_population(ga.population.get_all_chromosomes()[:ga.population.size()-next_population.size()] + next_population.get_all_chromosomes())