Adding a constraint using sum_expr and an index that is dependent on outside variables. #357
Unanswered
sarahjean0659
asked this question in
Q&A
Replies: 1 comment
-
Difficult to debug without a reproducible example. You might want to try the most recent |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am having issues with adding the below constraint using sum_expr and an index dependent on outside variables. It seems that when computing the choices of w, it isn't able to call the current choices for v, j, and k. Note that s[j,k] is an external data matrix.
add_constraint(sum_expr(sum_expr(b[j,k]*z[r,d,k,v,j,w], w=1:( v-s[j,k])), j=1:2) >= a[r,d,k,v]-u[r,d,k,v], r=1:2, d=1:2,k=1:2, v=1:10)
Is there an existing solution to this? Or do I just need to rewrite this formulation? If so, any suggestions would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions