diff --git a/src/EasyGA.py b/src/EasyGA.py index dd278c7..6776c4f 100644 --- a/src/EasyGA.py +++ b/src/EasyGA.py @@ -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."""