anyoptimization / pymoo

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

Bug: Random seed incorrectly set for CMAES optimizer #600

Open CodingTragic opened 2 months ago

CodingTragic commented 2 months ago

If the following is called, the seed is ignored.

algorithm = CMAES(popsize, ...)
algorithm.setup(problem, seed, termination)

The above setup method is located in base class Algorithm, which calls the _setup method of child class CMAES without providing the seed parameter, which is used to set a value of member "options"

Further, the setup method of base class Algorithm assigns an instance variable to the seed and thus providing the seed as a parameter is redundant - it can use the derived member "seed".

blankjul commented 2 months ago

Thanks for creating this issue.

Can you please check if the commit above fixed the problem?