Customizable update_population method

This commit is contained in:
SimpleArt
2021-01-04 23:01:54 -05:00
parent 42b78bcfea
commit fe2804bdbc

View File

@ -76,7 +76,7 @@ class GA(Attributes):
self.parent_selection_impl()
self.crossover_population_impl()
self.survivor_selection_impl()
self.population.update()
self.update_population()
self.sort_by_best_fitness()
self.mutation_population_impl()
@ -97,6 +97,12 @@ class GA(Attributes):
self.current_generation += 1
def update_population(self):
"""Updates the population to the new population and resets the mating pool and new population."""
self.population.update()
def reset_run(self):
"""Resets a run by re-initializing the population and modifying counters."""