在lingo中编程model:sets:time/1..51/:t;capacity/1..51/:c;order/1..25/:m,n;links(order,time):x;endsetsdata:t=10 16 9 21 16 14 8 10 12 10 9 11 14 8 13 17 17 9 10 13 14 8 17 20 15 16 12 8 10 9 18 10 13 11 21 16 15 17 24 22 26 12 18 11 15 16 9 14 12 1
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 02:10:20
在lingo中编程model:sets:time/1..51/:t;capacity/1..51/:c;order/1..25/:m,n;links(order,time):x;endsetsdata:t=10 16 9 21 16 14 8 10 12 10 9 11 14 8 13 17 17 9 10 13 14 8 17 20 15 16 12 8 10 9 18 10 13 11 21 16 15 17 24 22 26 12 18 11 15 16 9 14 12 1
在lingo中编程
model:
sets:
time/1..51/:t;
capacity/1..51/:c;
order/1..25/:m,n;
links(order,time):x;
endsets
data:
t=10 16 9 21 16 14 8 10 12 10 9 11 14 8 13 17 17 9 10 13 14 8 17 20 15 16 12 8 10 9 18 10 13 11 21 16 15 17 24 22 26 12 18 11 15 16 9 14 12 19 13;
c=12 9 15 10 20 16 10 12 17 24 14 6 9 10 7 19 21 12 9 16 8 5 17 16 8 9 12 14 11 19 24 14 12 16 9 6 21 15 10 14 9 22 16 8 14 15 16 9 14 23 16;
enddata
min=@sum(order(i):@max(time(j):x(i,j)*t(j));
@for(order(i):m(i)=@max(time(j):x(i,j)*t(j)));
@for(order(i):n(i)=@min(time(j):x(i,j)*t(j)));
@for(order(i):m(i)-n(i)
在lingo中编程model:sets:time/1..51/:t;capacity/1..51/:c;order/1..25/:m,n;links(order,time):x;endsetsdata:t=10 16 9 21 16 14 8 10 12 10 9 11 14 8 13 17 17 9 10 13 14 8 17 20 15 16 12 8 10 9 18 10 13 11 21 16 15 17 24 22 26 12 18 11 15 16 9 14 12 1
你的目标函数的最后差一个反括号!min=@sum(order(i):@max(time(j):x(i,j)*t(j)));
最好是在lingo11中运行,lingo 9.0中会提示你的变量超过范围!
结果是:
Local optimal solution found.
Objective value: 0.000000
Objective bound: 0.000000
Infeasibilities: 0.000000
Extended solver steps: 0
Total solver iterations: 4
如果你的程序的限制条件是对的话,就是这个结果了!你可以看看.