anyoptimization / pymoo

NSGA2, NSGA3, R-NSGA3, MOEAD, Genetic Algorithms (GA), Differential Evolution (DE), CMAES, PSO
https://pymoo.org
Apache License 2.0
2.25k stars 386 forks source link

CPU intensive computation with NGSA2 ? #140

Closed xplsek03 closed 3 years ago

xplsek03 commented 3 years ago

Hello,

great work with pymoo. Very abstract, seems to fulfill my need for solution-space search. I am following this tutorial: https://pymoo.org/customization/custom.html

I've implemented shifting bottleneck heuristic, which is very CPU intensive, in combination with NSGAII. Is it better to process this computation in overriden _evaluate method of Problem or _do method of Sampling (or is there virtually no difference)?

Thanks.

blankjul commented 3 years ago

If it should be executed for every solution it needs to be in _evaluate. If you put it in Sampling it will only take place for your initial population.

xplsek03 commented 3 years ago

Thanks.