作业帮 > 综合 > 作业

lingo提示MODEL IS ILL DEFINED.

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/12 15:49:41
lingo提示MODEL IS ILL DEFINED.
model:
sets:
project/1..7/;
year/1..5/;
assignment(project,year):a,b,c,d,e,x;
endsets
data:
a=360,600,400,950,10.5,6.8,7.0,
360,600,400,1350,10.5,6.8,7.0,
360,600,400,1350,10.5,6.8,7.0,
360,600,400,950,10.5,6.8,7.0,
360,600,400,1350,10.5,6.8,7.0;
b=20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0;
c=30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1;
d=0,0,0,400,3,0,0,
0,0,0,400,3,0,0,
0,0,0,400,3,0,0,
0,0,0,400,3,0,0,
0,0,0,400,3,0,0;
e=1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0;
enddata
max=@sum(assignment:a(i,j)*x(i,j));
@sum(assignment:b(i,j)*x(i,j))
lingo提示MODEL IS ILL DEFINED.
改成这样就行了
model:
sets:
project/1..7/;
year/1..5/;
assignment(project,year):a,b,c,d,e,x;
endsets
data:
a=360,600,400,950,10.5,6.8,7.0,
360,600,400,1350,10.5,6.8,7.0,
360,600,400,1350,10.5,6.8,7.0,
360,600,400,950,10.5,6.8,7.0,
360,600,400,1350,10.5,6.8,7.0;
b=20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0,
20,35,10,100,0.6,1,0;
c=30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1,
30,75,40,50,0.3,0,1;
d=0,0,0,400,3,0,0,
0,0,0,400,3,0,0,
0,0,0,400,3,0,0,
0,0,0,400,3,0,0,
0,0,0,400,3,0,0;
e=1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0,
1,1,1,1.5,0,0,0;
enddata
max=@sum(assignment(i,j):a(i,j)*x(i,j));
@sum(assignment(i,j):b(i,j)*x(i,j))
再问: 能不能来个理论上的解释,以便以后不犯这类错误
再答: 你自己对照一下我怎么改的就知道了 你的问题就是用下标的时候不声明下标 看我怎么声明的就行了