I'm trying to build an optimization scheduling program but I'm having troubles defining constrains for consecutive lunch time. It is easy to define a constrain setting that in a day of 8 hours, every worker must have at least 3 hours for lunch. With hrs being the model binary options for each hour, it would be something like Sum(hrs) >= 3
But for defining that those 3 hours must be consecutive I cant think of a way to set the constrain. I am starting to use disjuncts and so, but I dont know if it is the best way. Right now I am trying all of this with pyomo.
Intuition:
startlunch[t]=1is when we start lunch. We go fromlunch[t-1]=0tolunch[t]=1.lunch[-1]=0.