Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork495
Closed
Description
Suggestion:
I created a GA with pygad where the fitness function needs a lot of time to calculate (several minutes per fitness calculation). When I am manually stopping it by hittingCtrl+C I let the code continue and save the current state withga_instance.save("file"). When I start another run I load the last state withga_instance.load("file") and callga_instance.run() to continue with the current population. It would be neat to be able to continue the calculations without loosingga_instance.solutions etc., so when I callplot_fitness() my old data is still there. Currently withga_instance.run() everything gets reset to[].
Sample Code:
try:ga_instance=pygad.load("file")ga_instance.continue()exceptFileNotFoundError:ga_instance=pygad.GA([...])ga_instance.run()ga_instance.save("file")ga_instance.plot_fitness()