作业帮 > 综合 > 作业

lingo报错如下:Index variables may not share names with other var

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/06/15 16:53:26
lingo报错如下:Index variables may not share names with other variables.老是遇到这个问题,
model:
sets:
at/a1..a3/:x;
bt/b1..b4/:s1,s2;
ct/c1..c3/:s3;
links(at,bt):r;
endsets
min=@sum(at:x);
@sum(at:x)>=26;
@sum(bt:x)=s1(j));
@for(ct(j):@sum(bt(i):r(i,j)*s2(i))=16);
data:
s1=50 10 20 15;
s2=4 5 6 8;
enddata
end
lingo报错如下:Index variables may not share names with other var
model:
sets:
at/a1..a3/:x;
bt/b1..b4/:s1,s2;
ct/c1..c3/:s3;
links(bt,at):r;
endsets
min=@sum(at:x);
@sum(at:x)>=26;
@sum(at:x)=s1(i));
@for(ct(j):@sum(bt(i):r(i,j)*s2(i))=16);
data:
s1=50 10 20 15;
s2=4 5 6 8;
enddata
end