我有一段lingo代码老报错,求高手指点!!貌似错在目标函数上..
model:sets:dingdan/1..4/:g;c/1..3/:q;s1(dingdan,dingdan):d;s2(dingdan,dingdan,c):s;s3...
model:
sets:
dingdan/1..4/:g;
c/1..3/:q;
s1(dingdan,dingdan):d;
s2(dingdan,dingdan,c):s;
s3(dingdan,c):y;
endsets
data:
d=0,1,2,3,
1,0,7,8,
2,7,0,11,
3,8,11,0;
q=10,12,13;
g=6,7,8,10;
enddata
min=@sum(s2(i,j,k):d(i,j)*0.9*s(i,j,k))+@sum(s2(i,j,k):q(i)*d(i,j)*s(i,j,k)*y(i,k)*0.7);
@for(c(k):@sum(dingdan(i):g(i)*y(i,k))<=q(k));
@for(dingdan(i)|i#GT#1:@sum(c(k):y(i,k))=1);
@sum(c(k):y(1,k))=0;
@for(s3(i,k):@sum(dingdan(j):s(i,j,k))=y(i,k));
@for(s3(j,k):@sum(dingdan(i):s(i,j,k))=y(j,k));
@for(c(k):@sum(dingdan(i):y(i,k))<=3);
@for(s3(i,k):@bin(y(i,k)));
@for(s2(i,j,k):@bin(s(i,j,k)));
end 展开
sets:
dingdan/1..4/:g;
c/1..3/:q;
s1(dingdan,dingdan):d;
s2(dingdan,dingdan,c):s;
s3(dingdan,c):y;
endsets
data:
d=0,1,2,3,
1,0,7,8,
2,7,0,11,
3,8,11,0;
q=10,12,13;
g=6,7,8,10;
enddata
min=@sum(s2(i,j,k):d(i,j)*0.9*s(i,j,k))+@sum(s2(i,j,k):q(i)*d(i,j)*s(i,j,k)*y(i,k)*0.7);
@for(c(k):@sum(dingdan(i):g(i)*y(i,k))<=q(k));
@for(dingdan(i)|i#GT#1:@sum(c(k):y(i,k))=1);
@sum(c(k):y(1,k))=0;
@for(s3(i,k):@sum(dingdan(j):s(i,j,k))=y(i,k));
@for(s3(j,k):@sum(dingdan(i):s(i,j,k))=y(j,k));
@for(c(k):@sum(dingdan(i):y(i,k))<=3);
@for(s3(i,k):@bin(y(i,k)));
@for(s2(i,j,k):@bin(s(i,j,k)));
end 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询