这是我找的程序,跑不起来。。貌似有明显的错误。model:sets: p/0..8/:s,a,b; f/1..3/; m(f,p):y; l(p,p):d; h(p,p,f):x; endsetsdata: s=1,2,1,3,2,2.5,3,0.8;a=1,4,1,4,3,2,5,1.5;b=4,6,2,7,5.5,5,8,4;d=0,40,60,75,90,200,100,160,80, 40,0,65,40,100,50,75,110,100, 60,65,0,75,100,100,75,75,75, 75,40,75,0,100,50,90,90,150, 90,100,100,100,0,100,75,75,100, 200,50,100,50,100,0,70,90,75, 100,75,75,90,75,70,0,70,100, 160,110,75,90,75,90,70,0,100, 80,100,75,150,100,75,100,100,0; enddata minZ=@sum(h(i,j,k):d(i,j)*x(i,j,k)); @for(p(k):@sum(p(i):q(i)*y(k,i))); @for(p(i):@sum(f(k):y(k,i))=1); @for(m(k,j):@sum(p(i):x(i,j,k))=y(k,j)); @for(m(k,i):@sum(p(j):x(i,j,k))=y(k,i)); @for(p(i):@sum(m(k,j):x(i,j,k)*(d(i,j)/50+s(i)))<=b(i)); @for(p(i):@sum(m(k,j):x(i,j,k)*(d(i,j)/50+s(i)))>=a(i)); @for(m:@bin(y)); @for(h:@bin(x)); @for(@gin(n)); end
求大神帮我解决一个Lingo程序问题
第1个回答 2016-11-27
模型有问题,变量间的关系没有厘清,变量的下标关系也没有厘清。