Skip to content

Commit 0346c52

Browse files
committed
Update test for addConsIndicator with activeone flag
The test now checks addConsIndicator with both activeone=True and activeone=False, and updates the objective to use binvar.sum().
1 parent f181cf4 commit 0346c52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_cons.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ def test_cons_indicator_with_matrix_binvar():
185185
x = m.addVar(vtype="B")
186186
binvar = m.addMatrixVar(1, vtype="B")
187187
# binvar is a matrix variable to fix #1043
188-
m.addConsIndicator(x >= 1, binvar)
188+
m.addConsIndicator(x >= 1, binvar, activeone=True)
189+
m.addConsIndicator(x <= 0, binvar, activeone=False)
189190

190-
m.setObjective(binvar, "maximize")
191+
m.setObjective(binvar.sum(), "maximize")
191192
m.optimize()
192193

193194
assert m.getVal(x) == 1

0 commit comments

Comments
 (0)