Hello,

I am quite new to GAMS and would like some advice on how I could use conditions ($) in constraints.

- I have a constraint that is valid only upon certain condition. For example I have a constraint called ctFreez(p,t,a) with a variable q(p,t,a) where p,t,a are sets. For each review period a, I have a time period t of 8 weeks. I want to put a condition such that if current time period t (which means time period) is smaller or equal to 2, then the quantity of product p is equal to q(p,t,a-1), i.e. the value from the previous review period. Would the following work?:

ctFreez(p,t,a)…q(p,t,a)$t<=2 =e= q(p,t,a-1)

I read GAMS documents multiple times, but I wasn’t really sure whether I can put a condition like this.

\ - I have a constraint that rules shelf-life. The following restricts inventory such that the current inventory can fulfill demand only up until t+shelf life.

For this constraint, I typed Alias(t, dt) where dt is t’ in the constraint. But how can I put an upper bound for the summation? (i.e. sum t’ up until t+Shelf life (Lambda)).

Thanks a lot in advance for your help!