There is a nasty problem with the singleton set in GAMS. A singleton set is a set that can contain only zero or one element. Adding more elements implies replacement. I don't use it very often. Here is a reason why.
Consider the small example:
set i /i1*i20/; |
---- 12 PARAMETER p i1 1.717, i2 8.433, i3 5.504, i4 3.011, i5 2.922, i6 2.241, i7 3.498, i8 8.563 i9 0.671, i10 5.002, i11 9.981, i12 5.787, i13 9.911, i14 7.623, i15 1.307, i16 6.397 i17 1.595, i18 2.501, i19 6.689, i20 4.354 ---- 12 SET k ( EMPTY )
loop(i, |
---- 19 PARAMETER p i1 1.717, i2 8.433, i3 5.504, i4 3.011, i5 2.922, i6 2.241, i7 3.498, i8 8.563 i9 0.671, i10 5.002, i11 9.981, i12 5.787, i13 9.911, i14 7.623, i15 1.307, i16 6.397 i17 1.595, i18 2.501, i19 6.689, i20 4.354 ---- 19 SET k i19
No comments:
Post a Comment