scipopt / PyGCGOpt

Python interface and modeling environment for GCG
https://scipopt.github.io/PyGCGOpt/
MIT License
14 stars 4 forks source link

request for help #15

Closed fzu181800330 closed 1 year ago

fzu181800330 commented 1 year ago

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????

jurgen-lentz commented 1 year ago

Is this question related to pyscipopt?

jurgen-lentz commented 1 year ago

Issue closed due to inactivity.