早教吧 育儿知识 作业答案 考试题库 百科 知识分享

不好意思想问一下关于LINGO我用的是LINGO9破解版想请帮我看下MODEL:Titlelocationproblem;sets:demand/1..38/:a,b,d;supply/1..2/:x,y,e;link(demand,supply):c;endsetsdata:a=19.33,26.01,40.99,40.33,24,32.06,21.29,28.29,17.97,14.21,2

题目详情
不好意思 想问一下关于LINGO 我用的是LINGO9破解版 想请帮我看下
MODEL:
Title location problem;
sets:
demand/1..38/:a,b,d;
supply/1..2/:x,y,e;
link(demand,supply):c;
endsets
data:
a=19.33,26.01,40.99,40.33,24,32.06,21.29,28.29,17.97,14.21,29.22,15.13,41.82,19.81,18.73,42.69,15.59,29.84,34.17,33.39,22.43,18.83,75.14,24.82,56.42,36.74,36.92,44.02,47.43,19.8,36.59,30.64,46.71,63.43,56.32,8.53,34.91,57.03;
b=
29.09,31.6,55.01,51,65.87,19.12,41.64,36.95,26.61,15.3,73.96,31.61,40,19.24,23.7,23.4,31.01,31.16,52.53,37.28,17.7,18.21,0,1.43,55.51,50.68,28.5,30.13,39.01,21.23,75.93,70.38,67.4,56.4,27.31,0.49,44.26,54.32;
d=
20,25,20,25,5,20,5,10,30,25,10,40,20,15,20,30,16,15,15,25,15,15,30,30,10,20,35,30,15,25,10,8,30,5,70,40,15,10;e=500,500;
enddata
init:
x,y=41.82,40,19.8,21.23;
endinit
[OBJ]min=@sum(link(i,j):c(i,j)*((x(j)-a(i))^2+(y(j)-b(i))^2)^(1/2);
@for(demand(i):[DEMAND_CON] @sum(supply(j):c(i,j))=d(i););
@for(supply(i):[SUPPLY_CON] @sum(demand(j):c(j,i)
▼优质解答
答案和解析
里面很多小错误 括号配对不对 标点用中文等 lingo9有问题是在你写错了的情况下 写对了没问题
MODEL:
Title location problem;
sets:
demand/1..38/:a,b,d;
supply/1..2/:x,y,e;
link(demand,supply):c;
endsets
data:
a=19.33,26.01,40.99,40.33,24,32.06,21.29,28.29,17.97,14.21,29.22,15.13,41.82,19.81,18.73,42.69,15.59,29.84,34.17,33.39,22.43,18.83,75.14,24.82,56.42,36.74,36.92,44.02,47.43,19.8,36.59,30.64,46.71,63.43,56.32,8.53,34.91,57.03;
b=
29.09,31.6,55.01,51,65.87,19.12,41.64,36.95,26.61,15.3,73.96,31.61,40,19.24,23.7,23.4,31.01,31.16,52.53,37.28,17.7,18.21,0,1.43,55.51,50.68,28.5,30.13,39.01,21.23,75.93,70.38,67.4,56.4,27.31,0.49,44.26,54.32;
d=
20,25,20,25,5,20,5,10,30,25,10,40,20,15,20,30,16,15,15,25,15,15,30,30,10,20,35,30,15,25,10,8,30,5,70,40,15,10;e=500,500;
enddata
init:
x,y=41.82,40,19.8,21.23;
endinit
[OBJ]min=@sum(link(i,j):c(i,j)*((x(j)-a(i))^2+(y(j)-b(i))^2)^(1/2));
@for(demand(i):[DEMAND_CON] @sum(supply(j):c(i,j))=d(i));
@for(supply(i):[SUPPLY_CON] @sum(demand(j):c(j,i))