Negative Integer Variable

Problems with modeling
Post Reply
torsten123
User
User
Posts: 2
Joined: 1 month ago

Negative Integer Variable

Post by torsten123 » 1 month ago

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

User avatar
bussieck
Moderator
Moderator
Posts: 645
Joined: 5 years ago

Re: Negative Integer Variable

Post by bussieck » 1 month ago

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

torsten123
User
User
Posts: 2
Joined: 1 month ago

Re: Negative Integer Variable

Post by torsten123 » 1 month ago

That did the trick, thank you Michael!

Post Reply