2020-11-29

Gurobi Python constraint adding

I want to write the following constraint in gurobi python ,enter image description here

and I am writing that as the following and having key error. Can anyone help me by saying where I am doing mistake?

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")


from Recent Questions - Stack Overflow https://ift.tt/3fMaBLr
https://ift.tt/2VhhXwU

No comments:

Post a Comment