how to take sum of value from the different dictionaries?
回答済み
I have four dictionaries,
product_mill1, cost, time = gp.multidict({"0.5s1" : [0.1, 0.5],
"1.0s1" : [0.15, 0.6],
"2.0s1" : [0.25, 0.8],
"4.0s1" : [0.55, 0.1]})
product_mill2, cost, time = gp.multidict({"0.5s2" : [0.1, 0.5],
"1.0s2" : [0.18, 0.6],
"2.0s2" : [0.15, 0.8],
"4.0s2" : [0.50, 0.1],
"0.5h2" : [0.20, 1.0],
"1.0h2" : [0.30, 1.2],
"2.0s2" : [0.50, 1.6],
"4.0s2" : [1.00, 2.0]})
product_mill3, cost, time = gp.multidict({"0.5h3" : [0.13, 0.5],
"1.0h3" : [0.18, 0.6],
"2.0s3" : [0.28, 0.8],
"4.0s3" : [0.60, 1.0]})
product_mill4, cost, time = gp.multidict({"0.5s4" : [0.15, 0.1],
"1.0s4" : [0.20, 0.3],
"2.0s4" : [0.30, 0.6],
"0.5h4" : [0.25, 0.5],
"1.0h4" : [0.35, 1.6],
"2.0s4" : [0.55, 0.8]})
time_upperbound = 3600000
time_lowerbound = 1200000
demand_1s = 250000
demand_2s = 150000
demand_3s = 150000
demand_4s = 80000
demand_1h = 190000
demand_2h = 190000
demand_3h = 160000
demand_4h = 150000
how to take sum of the number of 0.5s(the product, which is x11+x12+x14) from four dictionaries, and let is less or equal than 250000?
how to set the objective function as cost* each variable from four dictionaries?
in another words, 0.5s1*0.1+1s2 *0.15+....... +2,0h3*0.55
-
正式なコメント
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Please see the response here.
Best regards,
Maliheh
0
投稿コメントは受け付けていません。
コメント
2件のコメント