Hello, My problem consists to determine the exact period of patient treatment. The duration of period is 30 minutes.
=> A patient is treated once on T periods. I have this constraint: At period t, if the sum of patient "p" treatment time with patients' treatment time to come before him does not exceed 30 minutes then Trait[p][t]=1 else Trait[p][t]=0 The formulation of constraint on CPLEX opl is
My problem when i add another constraint some patients will not treated at the exact period. My question is: how can I force this constraint to determine the exact treatment period. Best regards asked 19 Sep '16, 12:17 lolla 
If I understand your problem correctly I would suggest to modify the formulation as follows:
Your problem has some characteristics of a flexible job shop scheduling problem with one operation per job. It might worthwhile to have a look at some papers which discuss MILP formulations for this type of problems. answered 20 Sep '16, 03:55 Walter Hi, Thanks for the proposition. My problem when i add another constraint the period of treatment will change and is not exact (e.g: some patients will be treated in their exact period and others will not)
(20 Sep '16, 07:29)
lolla
What do you mean by "some patients will be treated in their exact period and others will not"? I think I am missing some important information here.
(20 Sep '16, 11:40)
Walter
I explain my problem in answers
(21 Sep '16, 06:58)
lolla

Constraints :
For example: i have 4 patients: theirs treatment period should be:
I obtain these treatment periods when i use only constraint 1 to 5. But when i add constraint 6, i will have :
(patient3 and 4 will be treated in others periods => and that is not true) answered 21 Sep '16, 06:56 lolla 
Is there a requirement/assumption that patients will be treated in the order of their indices (p=1 before p=2 before ...)? Otherwise (and I suspect the answer is no), the verbal constraint(specifically the "before him") is ambiguous. In period 1, for example, if there are six patients each with duration 10 minutes, after picking two arbitrarily (10 minutes left), wouldn't all four of the others qualify as "p" in the verbal constraint?