Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tmabdev opened this issue Mar 15, 2023 · 2 comments
Closed

Comments

@tmabdev
Copy link

tmabdev commented Mar 15, 2023

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
Copy link
Owner

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
Copy link
Author

tmabdev commented Mar 22, 2023

Hi,

Many thanks, it appears ok to me !

@tmabdev tmabdev closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants