Platypus
Platypus copied to clipboard
How to track the solutions for each generation using EpsNSGAII
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
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.
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.