i am a beginner,My original question is:
subto c3:forall in C2 : vif sum in C1:a[j]b[i]z[j,i] == 0 then C[i] == 0 else C[i] >=0 end;
I want to translate it into a question written in python language:
for i in C2:
expr = quicksum(a[j] b[i] z[(j, i)] for j in C1 if z[(j, i)] == 1)
if model.isEQ(expr,0):
model.addCons(C[i] == 0, "c4[%d]" % i)
else:
model.addCons(C[i] >= 0, "c4[%d]" % i)
compiler error:
if model.isEQ(expr,0):
File "src/pyscipopt/scip.pyx", line 1178, in pyscipopt.scip.Model.isEQ
TypeError: must be real number, not pyscipopt.scip.Expr
i am a beginner,My original question is: subto c3:forall in C2 : vif sum in C1:a[j]b[i]z[j,i] == 0 then C[i] == 0 else C[i] >=0 end;
I want to translate it into a question written in python language:
for i in C2:
expr = quicksum(a[j] b[i] z[(j, i)] for j in C1 if z[(j, i)] == 1)
if model.isEQ(expr,0):
model.addCons(C[i] == 0, "c4[%d]" % i)
else:
model.addCons(C[i] >= 0, "c4[%d]" % i)
compiler error: if model.isEQ(expr,0): File "src/pyscipopt/scip.pyx", line 1178, in pyscipopt.scip.Model.isEQ TypeError: must be real number, not pyscipopt.scip.Expr
how to save this question????