I want to write a conditional constraint using docplex. The constraint is:
if:
y[(i, j,k)] == 1 or y[(j, i,k)] == 1
then:
g[i,j,k]==1
I implemented the code in docplex in this way:
mdl.add(mdl.if_then(mdl.logical_or(y[(i, j,k)] == 1 ,y[(j, i,k)] == 1 ),g[i,j,k]==1))
But when I run I get this error:
DOcplexException: Expecting linear constraint, got: docplex.mp.LogicalOrExpr(y_13_16_14 == 1,y_16_13_14 == 1)
How can I resolve the error?