软件编程版 #305231 层

求助一个LINGO编程问题

楼主 · 1 楼
大家好,我最近用LINGO编了个程序,但有错误,自己怎么也找不出来,请各位高手帮帮忙,我刚学LINGO,还是菜鸟,有劳诸位了,在此先谢过了.
Title Location Problem;
sets:
demand/1..5/:x,y,d;
supply/1..4/:a,b,p;
link(demand,supply):M,c;
endsets
data:
!locations for the demand and supply;
x=-20,-20,80,-50,20;
y=20,100,-20,20,-
30;
a=50,50,-50,-80;
b=50,-50,-50,20;
!quantities of the demand;
d=95,87,40,7,40; enddata
init:
endinit
!Objebtive function;
[OBJ] min=@sum(link(i,j):M(i,j)*((x(i)-a(j))^2+(y(i)-b(j))^2)^(1/2));
c(i,j)=@if(((x(i)-a(j))^2+(y(i)-b(j))^2)^(1/2)#le#
300,1,0);
!demand constraints;@for(demand(i):@sum(supply(j): M(j,i))=d(i));@for(demand(i):@sum(supply(j): c(j,i))>=1);
!supply constraints;@for(supply(j): @sum(demand(i): M(i,j))=p(j));@bnd(0,pj,
300);@for(supply(j): @sum(demand(i): c(i,j))>=1);@for(demand: @free(x);@free(y););@for(supply: @free(a);@free(b););
END