pymoo icon indicating copy to clipboard operation
pymoo copied to clipboard

R-NSGA II optimizing a list of integer

Open Frederic-Le-Pivert opened this issue 1 year ago • 0 comments

I want to run the optimization of a list of integers. I have been able to run the equivalent code with the NSGA II, but, when using R-NSGA II, I got the following error:

File "/home/fred/.local/lib/python3.12/site-packages/pymoo/operators/sampling/rnd.py", line 24, in _do assert np.all(xu >= xl) ^^^^^^^^ TypeError: '>=' not supported between instances of 'dict' and 'dict'

If I use a np.ndarray, I have the error:

File "/home/fred/.local/lib/python3.12/site-packages/pymoo/core/problem.py", line 194, in init self.xl = {name: var.lb if hasattr(var, "lb") else None for name, var in vars.items()} ^^^^^^^^^^ AttributeError: 'numpy.ndarray' object has no attribute 'items'. Did you mean: 'item'?

Frederic-Le-Pivert avatar Oct 21 '24 09:10 Frederic-Le-Pivert