Created
August 21, 2019 11:28
-
-
Save syxolk/63e2f5d60d971d55676c99059ca04ede to your computer and use it in GitHub Desktop.
CPLEX logical_and does not work
This file contains 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
from docplex.mp.model import Model | |
m = Model("test") | |
a = m.binary_var(name="a") | |
b = m.binary_var(name="b") | |
c = m.binary_var(name="c") | |
m.add_constraint(m.logical_and(a, b) == c) | |
m.add_constraint(a == 1) | |
m.add_constraint(b == 0) | |
if m.solve(): | |
m.print_solution(print_zeros=True) | |
else: | |
print(m.solve_details) |
@PhilippeCouronne
Is the python interface well tested? If not, we don't mind using another interface :)
This is fixed in version 2.10.155 as of Aug 27, 2019. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid you have indeed hit on a bug in docplex (I have filed a bug report).
More information (and a workaround) can be found in IBM developerworks:
https://www.ibm.com/developerworks/community/forums/html/topic?id=b8ca2821-3f08-4cf2-a4c7-55253f5265fe
This bug will be fixed in the next release.
Philippe Couronne, IBM