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
How can I save the instance of a GA during the fitness evaluation of the population? In other words, if it has evaluated the fitness of 15 individuals over a population of 30, I would like to save the progress and, in the future, consider only the remaining 15.
I need that cause the evaluation of fitness, in my case, is done by a resource-intensive simulation where the fitness evaluation of the whole population takes a day. So if something happens and the run is terminated before the evaluation of every individual then I lose calculations that might worth up to one day.
The text was updated successfully, but these errors were encountered:
Saving the GA instance during the fitness evaluation will not save the fitness of the of the subset of solutions that have their fitness already calculated.
At the middle of calculating the fitness, the fitness is temporarily saved. It will be saved into an instance attribute called last_generation_fitness only after the fitness is calculated for all the solutions.
But you can add a new attribute to the GA instance before saving it. This attribute saves the fitness of the subset of solution with their fitness calculated.
This is an example that saves the solutions with their fitness calculated into the solutions_fitness attribute. If you stopped the GA before calculating the fitness for all the solutions, then the fitness is saved into the solutions_fitness attribute.
How can I save the instance of a GA during the fitness evaluation of the population? In other words, if it has evaluated the fitness of 15 individuals over a population of 30, I would like to save the progress and, in the future, consider only the remaining 15.
I need that cause the evaluation of fitness, in my case, is done by a resource-intensive simulation where the fitness evaluation of the whole population takes a day. So if something happens and the run is terminated before the evaluation of every individual then I lose calculations that might worth up to one day.
The text was updated successfully, but these errors were encountered: