Skip to content

Commit

Permalink
Correcting binary multiplication transformation's handling of nested GDP
Browse files Browse the repository at this point in the history
  • Loading branch information
emma58 committed Feb 18, 2024
1 parent 263d873 commit 664f302
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pyomo/gdp/plugins/binary_multiplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ def _transform_disjunctionData(
or_expr += disjunct.binary_indicator_var
self._transform_disjunct(disjunct, transBlock)

rhs = 1 if parent_disjunct is None else parent_disjunct.binary_indicator_var
if obj.xor:
xorConstraint[index] = or_expr == rhs
xorConstraint[index] = or_expr == 1
else:
xorConstraint[index] = or_expr >= rhs
xorConstraint[index] = or_expr >= 1
# Mark the DisjunctionData as transformed by mapping it to its XOR
# constraint.
obj._algebraic_constraint = weakref_ref(xorConstraint[index])
Expand Down

0 comments on commit 664f302

Please sign in to comment.