lingo提示错误missing right parenthesis
model:sets:factory/p1..p6/:p;warhouse/w1..w4/:a,f,g;customer/c1..c6/:d;tr/tr1..tr4/:z...
model:
sets:
factory/p1..p6/:p;
warhouse/w1..w4/:a,f,g;
customer/c1..c6/:d;
tr/tr1..tr4/:z;
link1(factory,warhouse):c,w;
link2(warhouse,customer):h,x;
endsets
data:
p=40000 50000 60000 70000 60000 40000;
a=70000 60000 70000 50000;
f=500000 300000 400000 400000;
g=3 2 5 4;
d=10000 20000 10000 20000 30000 10000;
c=6 5 4 2
2 3 4 9
6 8 7 5
7 4 2 3
4 2 5 1
3 4 1 7;
h=3 2 7 4 7 5
6 1 4 2 5 3
2 4 5 3 6 8
5 6 3 7 4 6;
enddata
min=@sum(link1(k,i):c(k,i)*w(k,i))+@sum(link2(i,j):h(i,j)*x(i,j))+@sum(link1(k,i):g(i)*w(k,i))+@sum(warhouse(i):f(i)*z(i));
@for(factory(k):
@sum(link1(k,i):w(k,i))<=p(k);
@for(warhouse(i):
@sum(link2(i,j):x(i,j))=@sum(link1(k,i):w(k,i));
@for(customer(j):
@sum(link2(i,j):x(i,j))>=d(j));
@sum(warhouse(i):
@sum(link1(k,i):w(k,i))<=(a(i)*z(i)));
@sum(tr(i):z(i))<=3;
@for(tr(i):@bin(z));
end
提示出错的是:@sum(link1(k,i):w(k,i))<=(a(i)*z(i)));
请各位大虾帮忙~~ 展开
sets:
factory/p1..p6/:p;
warhouse/w1..w4/:a,f,g;
customer/c1..c6/:d;
tr/tr1..tr4/:z;
link1(factory,warhouse):c,w;
link2(warhouse,customer):h,x;
endsets
data:
p=40000 50000 60000 70000 60000 40000;
a=70000 60000 70000 50000;
f=500000 300000 400000 400000;
g=3 2 5 4;
d=10000 20000 10000 20000 30000 10000;
c=6 5 4 2
2 3 4 9
6 8 7 5
7 4 2 3
4 2 5 1
3 4 1 7;
h=3 2 7 4 7 5
6 1 4 2 5 3
2 4 5 3 6 8
5 6 3 7 4 6;
enddata
min=@sum(link1(k,i):c(k,i)*w(k,i))+@sum(link2(i,j):h(i,j)*x(i,j))+@sum(link1(k,i):g(i)*w(k,i))+@sum(warhouse(i):f(i)*z(i));
@for(factory(k):
@sum(link1(k,i):w(k,i))<=p(k);
@for(warhouse(i):
@sum(link2(i,j):x(i,j))=@sum(link1(k,i):w(k,i));
@for(customer(j):
@sum(link2(i,j):x(i,j))>=d(j));
@sum(warhouse(i):
@sum(link1(k,i):w(k,i))<=(a(i)*z(i)));
@sum(tr(i):z(i))<=3;
@for(tr(i):@bin(z));
end
提示出错的是:@sum(link1(k,i):w(k,i))<=(a(i)*z(i)));
请各位大虾帮忙~~ 展开
展开全部
model:
sets:
factory/p1..p6/:p;
warhouse/w1..w4/:a,f,g;
customer/c1..c6/:d;
tr/tr1..tr4/:z;
link1(factory,warhouse):c,w;
link2(warhouse,customer):h,x;
endsets
data:
p=40000 50000 60000 70000 60000 40000;
a=70000 60000 70000 50000;
f=500000 300000 400000 400000;
g=3 2 5 4;
d=10000 20000 10000 20000 30000 10000;
c=6 5 4 2
2 3 4 9
6 8 7 5
7 4 2 3
4 2 5 1
3 4 1 7;
h=3 2 7 4 7 5
6 1 4 2 5 3
2 4 5 3 6 8
5 6 3 7 4 6;
enddata
min=@sum(link1(k,i):c(k,i)*w(k,i))+@sum(link2(i,j):h(i,j)*x(i,j))+@sum(link1(k,i):g(i)*w(k,i))+@sum(warhouse(i):f(i)*z(i));
@for(factory(k):
@sum(link1(k,i):w(k,i))<=p(k));
@for(warhouse(i):
@sum(customer(j):x(i,j))=@sum(factory(k):w(k,i)));
@for(customer(j):
@sum(warhouse(i):x(i,j))>=d(j));
@for(warhouse(i):
@sum(factory(k):w(k,i))<=(a(i)*z(i)));
@sum(tr(i):z(i))<=3;
@for(tr(i):@bin(z(i)));
end
sets:
factory/p1..p6/:p;
warhouse/w1..w4/:a,f,g;
customer/c1..c6/:d;
tr/tr1..tr4/:z;
link1(factory,warhouse):c,w;
link2(warhouse,customer):h,x;
endsets
data:
p=40000 50000 60000 70000 60000 40000;
a=70000 60000 70000 50000;
f=500000 300000 400000 400000;
g=3 2 5 4;
d=10000 20000 10000 20000 30000 10000;
c=6 5 4 2
2 3 4 9
6 8 7 5
7 4 2 3
4 2 5 1
3 4 1 7;
h=3 2 7 4 7 5
6 1 4 2 5 3
2 4 5 3 6 8
5 6 3 7 4 6;
enddata
min=@sum(link1(k,i):c(k,i)*w(k,i))+@sum(link2(i,j):h(i,j)*x(i,j))+@sum(link1(k,i):g(i)*w(k,i))+@sum(warhouse(i):f(i)*z(i));
@for(factory(k):
@sum(link1(k,i):w(k,i))<=p(k));
@for(warhouse(i):
@sum(customer(j):x(i,j))=@sum(factory(k):w(k,i)));
@for(customer(j):
@sum(warhouse(i):x(i,j))>=d(j));
@for(warhouse(i):
@sum(factory(k):w(k,i))<=(a(i)*z(i)));
@sum(tr(i):z(i))<=3;
@for(tr(i):@bin(z(i)));
end
追问
非诚感谢您~~
这个程序是一篇文献当中的,我用您的程序算了一下,跟文献中给出的答案稍有出入。
请问我给出的程序是哪里出错了呢?
追答
那就不知道了 你自己对照模型看一下跟这个写的是不是一致 我不知道你的问题是什么没法说
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询