Modeling with binary variables

Problems with modeling
Post Reply
Jessica
User
User
Posts: 2
Joined: 7 years ago

Modeling with binary variables

Post by Jessica »

Hi, i am an absolute beginner and can't find the right help in the documentation, so i hope someone here can help me:

How do I model that a binary variable x(i,t) (i=Projectnumber, t= Time) should have only adjacent ones, and the number of these ones depends on the Project duration d(i)?
Or maybe if there's a whole different way to assign projects on a fixed timespan, with ressource constraints dependent on t?

Thanks in advance, i'll appreciate any kind of tips : )
Jessica
Suresh Jakhar
User
User
Posts: 5
Joined: 7 years ago

Re: Modeling with binary variables

Post by Suresh Jakhar »

Hi Jessica,
in GAMS you would need to probably define sets for i and t. If they need to be adjacent you should probably check ordered sets. Also you should go through indexed mapping one set on other to incorporate d(i,t) type of variable.
https://www.gams.com/latest/docs/usergu ... _sets.html
And if you are a begineer you would probably do good to go through the following link as well.
https://www.gams.com/latest/docs/usergu ... sets_1.htm
Jessica
User
User
Posts: 2
Joined: 7 years ago

Re: Modeling with binary variables

Post by Jessica »

Hi Suresh, thanks for answering!
I've read the links you gave, and came up with the idea of summating the indicator variables to test if they are adjacent.
But now the program ignores that they have to be binary.
I'll attach the code (it's not much), thanks in advance for further help : )
simple_model.gms
(2.15 KiB) Downloaded 414 times
Jessica
Post Reply