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
-
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
Please sign in to leave a comment.
Comments
2 comments