Hi
I need to implement the following
Once I load a scalar value (say value for x) from an excel file, I need to use this value to create a sequence set as follows
Set i sequence given by the user /1*x/
This gives me an error, so how can I create a variable set, where the user will provide the length of this set.
Thank you
Variable sequence as a set
Re: Variable sequence as a set
Hi
You could define an overall set with the maximum of x as the number of elements:
Then you define a dynamic subset and use the value from excel to define it:
Renger
You could define an overall set with the maximum of x as the number of elements:
Code: Select all
set k /1*10000/;
Code: Select all
set i(k);
i(k)$(val.k < x+1) = YES;
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Re: Variable sequence as a set
Dear Renger
Thank you for help. This solution doesn't work with gams 24.5.3. It gives me error 140: unknown symbol and points to val.k; however, when I have tried
k.val instead of val.k, it worked. Thank you.
Regards
Wael
Thank you for help. This solution doesn't work with gams 24.5.3. It gives me error 140: unknown symbol and points to val.k; however, when I have tried
k.val instead of val.k, it worked. Thank you.
Regards
Wael