yunshengtian / AutoOED

AutoOED: Automated Optimal Experimental Design Platform
https://autooed.org
139 stars 18 forks source link

Difficulty trying to apply more than one constraint to optimization #13

Closed tmabdev closed 1 year ago

tmabdev commented 1 year ago

Hi !

I am having troubles trying to apply multiple constraints to my design variables. To reproduce my case :

  1. create a problem with 4 variables, 2 objectives and 2 constraints
  2. create a constraint.py file with constraints x1 - x2 and x1 - x3
  3. try to generate samples (5 in my example), an error pop : image

I think the problem comes from the evaluate_feasible() in problem.py, more specifically this call to pymoo when G contains multiple constraint evaluations :

Problem.calc_constraint_violation(np.column_stack(np.atleast_2d(G))).

If you need more informations please tell me.

yunshengtian commented 1 year ago

Hi,

Thank you so much for the bug report! Yes indeed here the column_stack call is not necessary. I have fixed that in my most recent commit just now.

tmabdev commented 1 year ago

Hi,

Many thanks, it appears ok to me !