为什么下面程序用lingo运行时出现subscript out of range on attribute 求解释?
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:英语作业 时间:2024/07/28 20:39:36
为什么下面程序用lingo运行时出现subscript out of range on attribute 求解释?
model:
sets:
cities/s,a1,a2,a3,b1,b2,c1,c2,t/:l;
roads(cities,cities)/
s,a1 s,a2 s,a3
a1,b1 a1,b2 a2,b1 a2,b2 a3,b1 a3,b2
b1,c1 b1,c2 b2,c1 b2,b2
c1,t c2,t/:d;
endsets
data:
d= 6 3 3
6 5 8 6 7 4
6 7 8 9
5 6;
l=0, , , , , , , ,;
enddata
@for(cities(i)|i#gt#1:
l(i)=@min(roads(j,i):l(j)+d(i,j)););
@free(i);@free(j);
end
model:
sets:
cities/s,a1,a2,a3,b1,b2,c1,c2,t/:l;
roads(cities,cities)/
s,a1 s,a2 s,a3
a1,b1 a1,b2 a2,b1 a2,b2 a3,b1 a3,b2
b1,c1 b1,c2 b2,c1 b2,b2
c1,t c2,t/:d;
endsets
data:
d= 6 3 3
6 5 8 6 7 4
6 7 8 9
5 6;
l=0, , , , , , , ,;
enddata
@for(cities(i)|i#gt#1:
l(i)=@min(roads(j,i):l(j)+d(i,j)););
@free(i);@free(j);
end
![为什么下面程序用lingo运行时出现subscript out of range on attribute 求解释?](/uploads/image/z/6964665-33-5.jpg?t=%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%8B%E9%9D%A2%E7%A8%8B%E5%BA%8F%E7%94%A8lingo%E8%BF%90%E8%A1%8C%E6%97%B6%E5%87%BA%E7%8E%B0subscript+out+of+range+on+attribute+%E6%B1%82%E8%A7%A3%E9%87%8A%3F)
你这个问题是什么 我只能这样给你改了
model:
sets:
cities/s,a1,a2,a3,b1,b2,c1,c2,t/:l;
roads(cities,cities)/
s,a1 s,a2 s,a3
a1,b1 a1,b2 a2,b1 a2,b2 a3,b1 a3,b2
b1,c1 b1,c2 b2,c1 b2,b2
c1,t c2,t/:d;
endsets
data:
d= 6 3 3
6 5 8 6 7 4
6 7 8 9
5 6;
enddata
calc:
l(1)=0;
@for(cities(i)|i#gt#1:
l(i)=@min(cities(j)|@in(roads,i,j):l(j)+d(i,j)););
endcalc
end
再问: 图3-22 最短路问题的模
这是我看的一个教程的截图,我上边的程序和他的一样可没法运行,我把你修改后的程序运行了一下可以,但结果和教程中的结果不一样,能不能再解释一下。谢谢!
再答: 那个教程写的不对 别管他
model:
sets:
cities/s,a1,a2,a3,b1,b2,c1,c2,t/:l;
roads(cities,cities)/
s,a1 s,a2 s,a3
a1,b1 a1,b2 a2,b1 a2,b2 a3,b1 a3,b2
b1,c1 b1,c2 b2,c1 b2,b2
c1,t c2,t/:d;
endsets
data:
d= 6 3 3
6 5 8 6 7 4
6 7 8 9
5 6;
enddata
calc:
l(1)=0;
@for(cities(i)|i#gt#1:
l(i)=@min(cities(j)|@in(roads,i,j):l(j)+d(i,j)););
endcalc
end
再问: 图3-22 最短路问题的模
![](http://img.wesiedu.com/upload/9/ec/9ec1d07cd2a691b21bf34f1261f8e005.jpg)
再答: 那个教程写的不对 别管他
为什么下面程序用lingo运行时出现subscript out of range on attribute 求解释?
subscript out of range 什么意思?
为什么用erdas进行重编码时出现Data value out of the range of LUT错误提示?
lingo程序求解释~
运行lingo程序出现unexpected jacobian
“subscript out of
lingo运行时出现improper use of set name!
lingo 程序为什么运行不出呢 高人指点
运行程序lingo程序,出现unexpected jacobian overflow
显示器出现out of range怎解决
启动运行XOSD时出现Scan line index out or range怎么解决
lingo程序如何运行