anyoptimization / pymoo

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

Considering duplicates across populations #608

Closed Leviathan321 closed 1 month ago

Leviathan321 commented 2 months ago

I am wondering whether there is a mechanism in pymoo to consider duplicates across populations to reduce the evaluation time? I am using the famework for an application where evaluations are expensive simulations. And I get a lot of duplicates sometimes.

I have only encountered so far dupliate elemination for the offspring generation. Is there such a mechanism across populations? Or can maybe someone sketch an appropriate place where this could be integrated?

blankjul commented 1 month ago

Yes that is possible. The easiest workaround is to cache all evaluations in your Problem. And then simply return the result in your cache once it is hit.

If you work with floats you can will need to define a distance to solutions in your cache and implement the hit based on an epsilon parameter.