You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a new on in PyGAD, and now I am using PyGAD to implement my multiple objective optimization problem. In your example, I learned how to the funcion on_generation() to get one best fitness of each generation:
Hi All,
I am a new on in PyGAD, and now I am using PyGAD to implement my multiple objective optimization problem. In your example, I learned how to the funcion on_generation() to get one best fitness of each generation:
def on_generation(ga_instance):
global last_fitness
print("Generation = {generation}".format(generation=ga_instance.generations_completed))
print("Fitness = {fitness}".format(fitness=ga_instance.best_solution(pop_fitness=ga_instance.last_generation_fitness)[1]))
print("Change = {change}".format(change=ga_instance.best_solution(pop_fitness=ga_instance.last_generation_fitness)[1] - last_fitness))
solution, solution_fitness, solution_idx = ga_instance.best_solution(pop_fitness=ga_instance.last_generation_fitness)
My question is that: can I get multiple best solutions (for example, I want to get best three solutions) in PyGAD?
Any suggestions would be greatly appreciated. Thanks
The text was updated successfully, but these errors were encountered: