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

Parametrize GenericModel with variable constraints #1502

Closed
blegat opened this issue Jul 28, 2021 · 2 comments · Fixed by #1521
Closed

Parametrize GenericModel with variable constraints #1502

blegat opened this issue Jul 28, 2021 · 2 comments · Fixed by #1521

Comments

@blegat
Copy link
Member

blegat commented Jul 28, 2021

The conic solvers don't support any variable constraints. So when implementing copy_to from their OptimizerCache, they will all need to check that no constraint variable is set. LP solvers supports some of them but not all so they will need to check that the ones they support are not set.
One way to improve the situation would be to allow GenericModel to have different type of variable containers.

@odow
Copy link
Member

odow commented Jul 28, 2021

Can't solvers just overload supports_constraint?

@blegat
Copy link
Member Author

blegat commented Jul 29, 2021

It would but I feel it's best too just make GenericModel modular.
Now it's just a combination of three submodels: one for the objective, one for the scalar variables constraints and one for the rest. It's just dispatching calls to the correct submodel, it's not specific at all to what is used as submodel. Allowing it to have any submodel would enable any combination of models. That also allows supporting other kind of SingleVariable constraints and other function as objective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants