Hi!
I have a problem with a constraint with if-then-else.
First of all, I try to explain what I would like to reach.
Index
s - surgical ward;
i - kind of surgical operation;
t - planning days{1, ..., 20};
Var
N_int_in[i,s,t] - number of operation of kind i belonging to ward s planned for the day t;
N_int_out[i,s,t+deg[i]] - number of patients that leave the hospital after recovery;
Param
deg[i] - deterministic number of days of recovery for the kind of operation;
I need to know how many patients leaves every day the hospital and, if they leave the hospital after 20-days-planning they are added in another variable: N_paz_in_post_pianificazione[s].
subject to CALCOLA_INT_OUT {s in S, t in T, i in I : uo[i] == s} :
if (t+deg[i] <= 20) then { N_int_in[i,s,t] = N_int_out[i,s,t+deg[i]] }
else { N_paz_in_post_pianificazione[s] = N_paz_in_post_pianificazione[s] + N_int_in[i,s,t] };
My problem is that AMPL inform that there is a syntax error in the equal sign:
syntax error
context: if (t+deg[i] <= 20) then { N_int_in[i,s,t] >>> = <<< N_int_out[i,s,t+deg[i]] }
Where is the problem? I made a mistake in writing the constraint?
Thank you for your support!