max_() function value does not match
AnsweredHi,
When I tried to use max_(), sometimes it does not work. See the code below:
for i in sub_intersection:
for pp in p:
for com in range(2,5):
m.addConstr(MissQueue_lb[com][pp,i]==max_([BeginBlock_final[i],uB[com][pp,i,'TH']],constant=None))
m.addConstr(MissQueue_tem[com][pp,i]==(uE[com][pp,i,'TH']-MissQueue_lb[com][pp,i])*q_LT[com][i+1])
m.addConstr(MissQueue[com][pp,i]==max_([MissQueue_tem[com][pp,i],0],constant=None))
When I print out each value:
What might be the reason causing this?
0
-
Official comment
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. -
Hi Yi Ting Lin,
Your print statements are referencing values for com = 1, but your com for-loop goes from 2 to 4 (inclusive).
Maybe you just need:
for com in range(1,5):
- Riley
0 -
Hi Riley,
Thanks for the help.
0
Post is closed for comments.
Comments
3 comments