Page 1 of 1

Negative Integer Variable

Posted: Sat Sep 04, 2021 8:50 pm
by torsten123
Hello everyone,

Im not a big GAMS expert, so I'm having some difficulties trying to create a variable, i hope this isn't too trivial. I know the bounds for the default are -inf to +inf and for the integer are 0 to +inf. However, for my model I require negative integer numbers as well. So basically the bounds of the default variable but only with integers. Does anyone know how to achieve this?

Many thanks in advance! :)

TF

Re: Negative Integer Variable

Posted: Mon Sep 06, 2021 10:54 am
by bussieck
It is as simple as setting the lower bound of an integer variable to -inf:

Code: Select all

Integer variable x(i); x.lo(i) = -inf;
-Michael

Re: Negative Integer Variable

Posted: Wed Sep 08, 2021 5:31 pm
by torsten123
That did the trick, thank you Michael!