关于 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))
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 21:47:26
ff FmnR0I#gKD O, !,L#{X1?]8qSzPWe4>Rه f_"[Ī}(<& ZNBn+Yn?`xpDUf&njzn#z+d8yJ221u
关于 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))
关于 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))
for循环里面的指标都是局部的 只在这句里面生效 其它句子里面使用的下标跟这个重复没关系
具体怎么写去找教程 有具体的格式