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
-
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
Please sign in to leave a comment.
Comments
2 comments