I want to model an integer programming example with docplex in python. for an indicator constraint I have this equation (X is a binary variable):
I wrote this code :
for i1,i2,i3 in P:
mdl.add_indicator_constraints(x[(i,j,k)] for i,j,k in ijk if i==i1 and j==i2 and k==i3)==0
I don't know if I am using the right command for defining this indicator. when I run the program I get this error:
cpx_indvars.append(logct.binary_var.safe_index)
AttributeError: 'Var' object has no attribute 'binary_var'