lingo !subscript out of range on attribute:y. 求助!急求!model:!问题;min=(@sum(x))^2-(@sum(ver))^2;sets:province/pr1..pr3/:pro;vertical/ve1..ve5/:ver;links(province,vertical):x,y; endsetsdata:pro=15 9 5;ver=9 8 10 1 1;y=0.5 0.5 0.5 0.5 0.5 0.3
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 19:03:45
lingo !subscript out of range on attribute:y. 求助!急求!model:!问题;min=(@sum(x))^2-(@sum(ver))^2;sets:province/pr1..pr3/:pro;vertical/ve1..ve5/:ver;links(province,vertical):x,y; endsetsdata:pro=15 9 5;ver=9 8 10 1 1;y=0.5 0.5 0.5 0.5 0.5 0.3
lingo !subscript out of range on attribute:y. 求助!急求!
model:
!问题;
min=(@sum(x))^2-(@sum(ver))^2;
sets:
province/pr1..pr3/:pro;
vertical/ve1..ve5/:ver;
links(province,vertical):x,y;
endsets
data:
pro=15 9 5;
ver=9 8 10 1 1;
y=0.5 0.5 0.5 0.5 0.5 0.3 0.3 0.3 0.3 0.3 0.2 0.2 0.2 0.2 0.2;
enddata
@for(vertical(i)|i#le#5:
x(i,j)ver(i)*y(i,j)-1);
@for(vertical(i)|i#le#5:
@sum(province(j)|j#le#3:x(i,j))=ver(i));
@for(province(j)|j#le#3:
@sum(vertical(i)|i#le#5:x(i,j))=pro(j));
@for(vertical(i)|i#le#5:@gin(x));
end
lingo !subscript out of range on attribute:y. 求助!急求!model:!问题;min=(@sum(x))^2-(@sum(ver))^2;sets:province/pr1..pr3/:pro;vertical/ve1..ve5/:ver;links(province,vertical):x,y; endsetsdata:pro=15 9 5;ver=9 8 10 1 1;y=0.5 0.5 0.5 0.5 0.5 0.3
首先第一句语法就不对 @sum应该是@sum(集名:表达式) 你这个写的完全不对 另外你不要在集定义前面就写集循环函数
后面你@for只对i循环了 那j是多少?是某个确定的数还是要对j循环?你都没有写