pymoo icon indicating copy to clipboard operation
pymoo copied to clipboard

Equality constraints not working

Open AnvarAtayev opened this issue 3 years ago • 1 comments

Hello, I am trying to add equality constraints.

I do this by adding a H key into out within _evalaute. But whenever I try to run this, I get the exception: "Exception: ('Problem Error: H can not be set, expected shape (100, 0) but provided (100, 1)', ValueError('cannot reshape array of size 100 into shape (100,0)')"

Any help with this would be much appreciated 😄

AnvarAtayev avatar Aug 11 '22 14:08 AnvarAtayev

The new version has a check if what you set as an output fits the problem description. Have you defined the problem in such a way that n_eq_constr=1?

(Please note that most algorithms are not that efficient when optimization equality constraints. But I wanted to add this new feature for researchers to work on new methods and also to keep the G problem suite consistent)

blankjul avatar Aug 13 '22 22:08 blankjul