Platypus icon indicating copy to clipboard operation
Platypus copied to clipboard

How to track the solutions for each generation using EpsNSGAII

Open tianjingyao opened this issue 5 years ago • 1 comments

I tried "algorithm = EpsNSGAII(problem, 0.01, population_size=10) algorithm.run(1000) nondominated_solutions = nondominated(algorithm.result)" it only returned the pareto fronts. How could I obtain the solustion for each generation? I have also tried the code https://github.com/Project-Platypus/Platypus/issues/71#issuecomment-513524660 but it only works for NSGAII. I don't know how to do it for EpsNSGAII

tianjingyao avatar Aug 10 '19 13:08 tianjingyao

You can pass a callback function to the run method:

algorithm.run(1000, callback=foo)

and then create the foo function, that receives an instance of the algorithm. This function will be called after each step in the algorithm. Inside this foo function you can do whatever you want, for instance, save all generations for a later analysis.

pmguerre avatar Oct 15 '19 00:10 pmguerre

This issue is stale and will be closed soon. If you feel this issue is still relevant, please comment to keep it active. Please also consider working on a fix and submitting a PR.

github-actions[bot] avatar Nov 04 '22 20:11 github-actions[bot]