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

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/userguides/userguide/_u_g__ordered_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/userguides/mccarl/sets_1.htm

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 KB)

Jessica