I have a binary variable $y_{t}$ that is equal to $1$ iff the job is scheduled at slot $t$. I need to write constraints that guarantee that if the job is scheduled somewhere, then it must be scheduled for a period of $A$ consecutive slots. I tried to write it this way:
$\sum_{t'=t}^{t+A-1}y_{t'}\geqslant A y_t$ for all $t$.
Here I can see that if $y_t=1$ then I must have $y_{t+1}=\ldots=y_{t+A-1}=1$. The problem with this is that I will have $y_{t'}=1$ for all $t'\geqslant t$ because of the recurrence relation I have in my constraints.
After some effort, I found this way to do it: introduce binary variable $z_t$and add the constraints
$\sum_{t}z_t\leqslant 1$and $z_t\sum_{t'=t}^{t+A-1}y_{t'}\geqslant A y_t z_t$ for all $t$.
But, if I am correct, this is a non-linear constraint.