Gurobi model is stuck not even assigning variables
ユーザーの入力を待っています。m = gp.Model('firestations_location')
print('hi')
m.setParam('TimeLimit', 5*60)
X = m.addVars(N, vtype=GRB.BINARY, name='X')
print(1)
F = m.addVars(N,N, vtype=GRB.CONTINUOUS, name='F')
y = m.addVars(N,N, vtype=GRB.BINARY, name='y')
print('hi')
m.addConstrs((1-Y[i]>=X[i] for i in range(N)),name="C1")
m.addConstrs((F[(i,i)]==0 for i in range(N)),name="C2")
m.addConstrs((DIST[(i,j)]-S<=M1*y[(i,j)] for i in range(N) for j in range(N)),name="C3")
m.addConstrs((F[(i,j)]<=M2*(1-y[(i,j)]) for i in range(N) for j in range(N)),name="C4")
m.addConstrs((GRB.quicksum(F[(i,j)]*(C[j]*Y[j]+C_new*X[j])) >= FR[i] for i in range(N) for j in range(N)),name="C5")
print("hi")
obj=GRB.quicksum(X[i] for i in range(N))
m.setObjective(obj,GRB.MINIMIZE)
(MODEL IN JUPYTER NOTEBOOK)
I tried debugging by understanding where it might have stucked, but its not working. Any idea on how to understand where the issue might be. Similar problem on small data worked in AMPL, so I am thinking there might be some syntax issue. Please advise!
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. -
Your code snippet is not reproducible. There are multiple definition missing, e.g., \(\texttt{N, Y, DIST, S, M1, C, C_new, FR}\)
Could you please generate a minimal reproducible example?
0
投稿コメントは受け付けていません。
コメント
2件のコメント