I have a scheduling problem with one machine and one job. I defined a binary variable $z_t$ that is 1 iff the job is scheduled at time $t$ (the job can be served in multiple times that are not consecutive). I would like to find the intervals where the machine is idle.
For example, if the job is scheduled at $t=1$, $t=4$, $t=8$, and $t=11$, then the machine is idle between $t=2$ and $t=3$, which gives an interval of length $2$. It is idle between $t=5$ and $t=7$, which gives an interval of length $3$. And, it is idle between $t=9$ and $t=10$, which gives an interval of length $2$.
How can I write this using the variable $z_t$? Say, I would like to enforce a constraint that says that the machine must be idle for intervals whose length are shorter than a threshold?