-
Notifications
You must be signed in to change notification settings - Fork 562
GDP: Fix bug transforming Blocks in gdp.mbigm transformation
#3811
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
Open
bammari
wants to merge
10
commits into
Pyomo:main
Choose a base branch
from
bammari:mbigm-resolve-names
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+35
−2
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a78f5a5
Change getname argument relative_to to ensure constraint and disjunct…
bammari 85d5fa6
Add test to ensure transformation works on block
bammari c67ec2c
assertEqual instead of assert
bammari c79c58b
black and assert names equal
bammari 4298328
assert names equal
bammari fd5dc25
Merge branch 'Pyomo:main' into mbigm-resolve-names
bammari 7fd5d1b
skip transform on block test if Gurobi not available
bammari 4054409
Merge branch 'mbigm-resolve-names' of https://github.com/bammari/pyom…
bammari e4986a0
Add assertions that test whether linear constraint in disjunct 1 is t…
bammari 1a00db6
Merge branch 'main' into mbigm-resolve-names
blnicho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question: this tests the case where all the variables are defined by the subtree being transformed. What happens if one of the Vars is defined outside the subtree (e.g., on
minstead of underm.b)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsiirola In this example, if we defined variable x as
m.xinstead ofm.b.x, the transformed expression would be:0.5 * m.x + 3 - m.b.y <= 3.5 * m.b.dis2.binary_indicator_varinstead of0.5 * m.b.x + 3 - m.b.y <= 3.5 * m.b.dis2.binary_indicator_varDo you see any potential issues with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope - that should be fine. I don't think it will be a huge issue, as the change this PR is making doesn't actually affect Vars (I wasn't thinking clearly last night -- you are only getting relative names for active components [Constraints & Disjuncts] - and not Vars).
BUT, this does raise the question: what do we expect the following to do??
Thoughts? @emma58?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Spot checking... this update to
mbigmleads to an exception.bigmwill transform the model (including deactivatingm.d1)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(@emma58 crawls under a table...)
(From under the table,) we expect the model above to put the transformed constraints on
m.b, and to deactivatem.d1andm.b.d2. Scoping should be determined by the Disjunction and not care about where the Disjuncts are living at all. So basically, thebigmbehavior is the desired behavior. I can look at this...