首页 > 中学英语试题 > 题目详情
关于 LINGO @FOR 语句请问下面的@for 语句中为什么@for(set1(i):@sum(set1(k):x(
题目内容:
关于 LINGO @FOR 语句
请问下面的@for 语句中为什么@for(set1(i):@sum(set1(k):x(k))=1); i j k 总是在换啊?
model:
sets:
set1/1..2/:x;
set2/1..2/:y;
link(set1,set2):a,b;
endsets
@for(set1(i):@sum(set1(k):x(k))=1);
@for(set2(j):@sum(set2(k):y(k))=1);
@for(link(i,j):@sum(link(p,q):x(p)*a(p,q)*y(q))
>=@sum(link(i,q):a(i,q)*y(q)));
@for(link(i,j):@sum(link(p,q):x(p)*b(p,q)*y(q))
>=@sum(link(t,j):x(t)*b(t,j)));
data:
a=70 100
40 140;
b=70 40
100 140;
enddata
end
关于 LINGO @FOR 语句
请问下面的@for 语句中为什么@for(set1(i):@sum(set1(k):x(k))=1); i j k 总是在换啊?
model:
sets:
set1/1..2/:x;
set2/1..2/:y;
link(set1,set2):a,b;
endsets
@for(set1(i):@sum(set1(k):x(k))=1);
@for(set2(j):@sum(set2(k):y(k))=1);
@for(link(i,j):@sum(link(p,q):x(p)*a(p,q)*y(q))
>=@sum(link(i,q):a(i,q)*y(q)));
@for(link(i,j):@sum(link(p,q):x(p)*b(p,q)*y(q))
>=@sum(link(t,j):x(t)*b(t,j)));
data:
a=70 100
40 140;
b=70 40
100 140;
enddata
end
请问下面的@for 语句中为什么@for(set1(i):@sum(set1(k):x(k))=1); i j k 总是在换啊?
model:
sets:
set1/1..2/:x;
set2/1..2/:y;
link(set1,set2):a,b;
endsets
@for(set1(i):@sum(set1(k):x(k))=1);
@for(set2(j):@sum(set2(k):y(k))=1);
@for(link(i,j):@sum(link(p,q):x(p)*a(p,q)*y(q))
>=@sum(link(i,q):a(i,q)*y(q)));
@for(link(i,j):@sum(link(p,q):x(p)*b(p,q)*y(q))
>=@sum(link(t,j):x(t)*b(t,j)));
data:
a=70 100
40 140;
b=70 40
100 140;
enddata
end
本题链接: