我如何修复 Gams 中的错误 149?(未控制的设置作为常量输入)
How can I fix Error 149 in Gams?(Uncontrolled set entered as constant)
我在GAMS中遇到这种情况:
sets
i index of resource location /i1*i6/
j index of disaster location /j1*j7/
;
...
binary variable x(i,j);
parameter
M(j) /j1 5,j2 4,j3 6,j4 7,j5 6,j6 2,j7 1/
ch(i) /i1 10,i2 5,i3 10,i4 15,i5 6,i6 12/
;
...
equations
...
co8(i)
;
co8(i)..M(j)=l=sum(j,ch(i)*x(i,j));
和 co8(i)
给我错误 149 Uncontrolled set entered as constant.
我搜索过,但没有找到解决方案。
我该如何解决?
谢谢
M(j)
中的j
不受控制。所以,这取决于你想做什么,如何解决这个问题。例如。如果你想要所有 j
的总和,你应该加上那个总和 (sum(j,M(j))
)。或者你想要每个 j
这个等式吗?然后相应地调整声明和定义。
我在GAMS中遇到这种情况:
sets
i index of resource location /i1*i6/
j index of disaster location /j1*j7/
;
...
binary variable x(i,j);
parameter
M(j) /j1 5,j2 4,j3 6,j4 7,j5 6,j6 2,j7 1/
ch(i) /i1 10,i2 5,i3 10,i4 15,i5 6,i6 12/
;
...
equations
...
co8(i)
;
co8(i)..M(j)=l=sum(j,ch(i)*x(i,j));
和 co8(i)
给我错误 149 Uncontrolled set entered as constant.
我搜索过,但没有找到解决方案。 我该如何解决?
谢谢
M(j)
中的j
不受控制。所以,这取决于你想做什么,如何解决这个问题。例如。如果你想要所有 j
的总和,你应该加上那个总和 (sum(j,M(j))
)。或者你想要每个 j
这个等式吗?然后相应地调整声明和定义。