How to assign other variables based on the range of decision variables
回答済みSuppose there is a decision variable time_arrive[i] with value b, I think rate[t,i]=1 when t is at time_arrive[i] and time_arrive[i]+b.
Since time_arrive[i] is a decision variable, it is difficult to implement.
it's like
for t in range(T):
for i in range(I):
if time_arrive[i]<=t<=time_arrive[i]+b:
rate[t,i]=1
0
-
正式なコメント
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. -
We discuss how to model conditional statements in the Knowledge Base article How do I model conditional statements in Gurobi? Please note that in your case, since you do not need a strict inequality, you do not have to introduce a positive threshold \(\epsilon\).
In addition to the conditional statements \(ta \leq t\) and \(t \leq ta+b\) you will have to use the addGenConstrAnd method to model the "and" relation.
0 -
Thank you very much and have a great weekend.
0
投稿コメントは受け付けていません。
コメント
3件のコメント