Why "constraint has no bool value (are you trying "lb <= expr <= ub"?)"
Answeredmdl.addConstrs(quicksum(x[0,i,k] for i in N) == (y[j,0,k] for j in N) <= 1 for k in K)
mdl.addConstrs(u[i,p,k]-u[j,p,k]+m[p]*x[i,j,k] <= m[p]-q[j,p] for i in V for j in V if i!=j
for k in K for p in P)
My code has this error "constraint has no bool value (are you trying "lb <= expr <= ub"?)"
Can someone help me?
0
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Your first constraint
mdl.addConstrs(quicksum(x[0,i,k] for i in N) == (y[j,0,k] for j in N) <= 1 for k in K)
reads \(\sum_{i \in N} x_{0,i,k} = y_{j,0,k} \forall j \in N \leq 1 \forall k \in K\). As you can see there is definitely at least one (in)equality too many.
For additional details, please refer to the Knowledge Base article Constraint has no bool value (are you trying "lb <= expr <= ub"?).
Best regards,
JaromiłBest regards,
Jaromił0 -
Dear Jaromil,
Thanks a lot.
Best regards,
Ma
0
Post is closed for comments.
Comments
3 comments