jMetal / jMetalPy

A framework for single/multi-objective optimization with metaheuristics
https://jmetal.github.io/jMetalPy/index.html
MIT License
497 stars 150 forks source link

How to change evaluation on NSGA2? #129

Closed Andreas-SM closed 2 years ago

Andreas-SM commented 2 years ago

All of the Evaluator classes seem to perform sequential evaluation of some kind, i.e. individuals of the population are evaluated one at a time by the objective function. Is there a way to pass the entire population at once to the objective function (as a numpy.array or pandas.DataFrame) so as to reduce NSGA2's total computation time per generation?

ajnebro commented 2 years ago

Hi. There are several subclasses of Evaluator that computes the evaluations in parallel: MultiprocessEvaluator, SparkEvaluator and DaskEvaluator.

Antonio

Andreas-SM commented 2 years ago

Hello Antonio,

I was hoping to pass a matrix containing all members of the population to the objective function, so as to make only one evaluation instead of many in parallel. I actually managed to solve the problem by creating a new Evaluator class and subclass and using it on a slightly different version of the GeneticAlgorithm and NSGA2 classes.