lingo报错如下:Index variables may not share names with other variables.遇到这个问题,model:sets:al_i/1..6/;al_j/1..6/;wt/1..6/:w;link(al_i,al_j):dl_ij,du_ij,rl_ij,ru_ij;endsetsdata:rl_ij=0.50,0.50,0.60,0.43,0.60,0.77,0.33,0.50,0.50,0.33,0.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 12:31:28
lingo报错如下:Index variables may not share names with other variables.遇到这个问题,model:sets:al_i/1..6/;al_j/1..6/;wt/1..6/:w;link(al_i,al_j):dl_ij,du_ij,rl_ij,ru_ij;endsetsdata:rl_ij=0.50,0.50,0.60,0.43,0.60,0.77,0.33,0.50,0.50,0.33,0.
lingo报错如下:Index variables may not share names with other variables.遇到这个问题,
model:
sets:
al_i/1..6/;
al_j/1..6/;
wt/1..6/:w;
link(al_i,al_j):dl_ij,du_ij,rl_ij,ru_ij;
endsets
data:
rl_ij=0.50,0.50,0.60,0.43,0.60,0.77,0.33,0.50,0.50,0.33,0.47,0.53,0.20,0.30,0.50,0.37,0.40,0.60,0.33,0.53,0.47,0.50,0.57,0.60,0.23,0.37,0.40,0.27,0.50,0.50,0.10,0.10,0.20,0.20,0.23,0.50;
ru_ij=0.50,0.67,0.80,0.67,0.77,0.90,0.50,0.50,0.70,0.47,0.63,0.90,0.40,0.50,0.50,0.53,0.60,0.80,0.57,0.67,0.63,0.50,0.73,0.80,0.40,0.53,0.60,0.43,0.50,0.77,0.23,0.47,0.40,0.40,0.50,0.50;
dl_ij=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
du_ij=0,0,0,0,0,0.025,0,0,0,0,0,0,0,0,0,0,0,0.025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
enddata
min=wl;
@for(link(al_i,al_j)|j#ge#(i+1):0.5*(w(i)+w(j)+1)+dl_ij>=rl_ij);
@for(link(al_i,al_j)|j#ge#(i+1):0.5*(w(i)-w(j)+1)-du_ij=0);
@sum(wt(i):w(i))=1;
end
lingo报错如下:Index variables may not share names with other variables.遇到这个问题,model:sets:al_i/1..6/;al_j/1..6/;wt/1..6/:w;link(al_i,al_j):dl_ij,du_ij,rl_ij,ru_ij;endsetsdata:rl_ij=0.50,0.50,0.60,0.43,0.60,0.77,0.33,0.50,0.50,0.33,0.
@for 后面应该是link(i,j)