adding constraint
回答済みHello,
I want to add the following constraint in gurobi python
I tried the following code and having a keyerror.
for (i,j) in road_node:
for t in range(1,n_time_horizon+1):
m.addConstr(sum([x[v,i,u,j,u+fftt[(i,j)]] for v in vehicle_list for u in range(1,n_time_horizon+1) if u>=0 and u<=t]) - sum([x[v,j,u,i,u+fftt[(j,i)]] for v in vehicle_list for (j,i) in road_node for u in range(1,n_time_horizon+1) if u>=0 and u<=t]) <= l[(i,j)],name = "cont_4")
Could anyone please help me with this like where am i doing mistake?
-1
-
正式なコメント
This post is more than three 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 why not try our AI Gurobot?. -
Hi Farzana,
Your code is not self-contained making it very hard to help you. In particular, could you provide the definition of \(\texttt{vehicle_list, n_time_horizon, road_node,}\) and \(\texttt{fftt}\).
Best regards,
Jaromił0 -
This post is continued in https://support.gurobi.com/hc/en-us/community/posts/360075061571
0
投稿コメントは受け付けていません。
コメント
3件のコメント