lingo 错误 就是得不到结果,求高手指点
发布网友
发布时间:2024-07-04 04:22
我来回答
共1个回答
热心网友
时间:2024-07-04 19:52
model:
sets:
dq/d1..d6/:Xi;
school/s1..s3/:Xj,Sj;!xj表示j学校人数 ,Sj表示j学校的容量;;
gread/g1..g3/:;
link1(dq,school):Wij,Yij;!Wij表示i地区到j学校的人数,Yij表示i地区到j学校的费用;
link2(dq,gread): pik,Xik;
link3(school,gread):;
allowed(dq,school,gread):Xijk;
endsets
data:
Sj=900 1100 1000;
Yij=300 0 700
0 400 500
600 300 200
200 500 0
0 0 400
500 300 0;
Xik=144 171 135
222 168 210
165 176 209
98 140 112
195 170 135
153 126 171;
enddata
min=@sum(link1:Wij*Yij);
@for(link2(i,k):
@sum(school(j):Xijk(i,j,k))=Xik(i,k)
!Xik(i,k)=pik(i,k)*Xi(i););
@for(school(j):
@sum(link2(i,k):Xijk(i,j,k))<=Sj(j));
@for(link3(j,k):
@sum(dq(i):Xijk(i,j,k))>=0.3*@sum(link2(i,k1):Xijk(i,j,k1));
@sum(dq(i):Xijk(i,j,k))<=0.36*@sum(link2(i,k1):Xijk(i,j,k1)));
@FOR(allowed:@GIN(Xijk));
@for(link1(i,j):wij(i,j)=@sum(gread(k):xijk(i,j,k)));
@for(gread(k):
Xijk(2,1,k)=0;
Xijk(5,2,k)=0;
Xijk(4,3,k)=0);
end