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

Constraint Class #24

Merged
merged 6 commits into from
Oct 10, 2023
Merged

Conversation

TobyBoyne
Copy link
Collaborator

This PR implements a Constraint class that enables a more user friendly handling of constraints, as well as a delay between constraint definition and application to a model.

This is currently a draft pending a little more documentation and a few test cases. A jupyter notebook constraint_classes.ipynb is provided to demonstrate the functionality.

Let me know what you think! The aim is for useability, so let me know how it reads. My biggest issue at the moment is that creating the constraint requires the ConcreteModel (for access to the variables) and ProblemConfig.feat_list (for the names of the variables). This feels slightly clunky, but I think is necessary for how ENTMOOT is written.

Also this currently only supports Pyomo, not Gurobi. If this works well for Pyomo then I'm happy to have a look at transferring over!

Thanks,
Toby

@TobyBoyne TobyBoyne marked this pull request as ready for review September 18, 2023 11:11
@spiralulam spiralulam self-requested a review October 10, 2023 14:20
Copy link
Collaborator

@spiralulam spiralulam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the constraint classes are a useful extension of ENTMOOT. Thank you.

@spiralulam spiralulam merged commit 1079571 into cog-imperial:master Oct 10, 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

Successfully merging this pull request may close these issues.

2 participants