Hi,

I would like to know what’s the problem with all the statements that I tried to use in order to search about the first date t in T where Act[j,t] equals to 1.

In fact, **Act[i,j] is a binary variable which equals to 1 is the project j is executed in the period t and 0 otherwise**.

I am trying to express the starting and finishing date of my model using the variable Act[i,j] where :

**Start = the first date t where Act[j,t]=1****Finish= the last date t where Act[j,t]=1**

For Finish date, I used the following statement, and it is working :

subject to FinContrainte{j in P}:

Fin[j] = max {t in T} (t * Act[j, t]);

However, for the start date none of the following statement worked :

subject to DebutContrainte{j in P}:

Debut[j] = ord(t in T: Act[j, t] > 0, t); **#Here it said syntax error**

subject to DebutContrainte{j in P}:

Debut[j] = ord(t in T, (Act[j, t] = 1)); **#Here it said syntax error as well**

subject to FinContrainte{j in P}:

Debut[j] = min {t in T} (t * Act[j, t]); **#Here it just presents Debut = 0 as there is no condition on Act(j,t)**

subject to DebutContrainte{j in P}:

Debut[j] = ord(t, (t in T)$(Act[j, t] = 1)); **#Here it said syntax error as well**

For the following statement :

subject to DebutContrainte{j in P}:

Debut[j] = min {t in T: Act[j, t] = 1} t; **it shows** **variable in such-that part of set specification**

context: Debut[j] = min {t in T: Act[j, t] = >>> 1} <<< t;

Thanks in advance!!!