I am using OR-Tools for an employees scheduling problem. I have a dictionary that is defined as an IntVar, where such dictionary contains the number of hours that will be assigned to each employee, ranging from zero to availability_for_day:
intvars[ID_VAR] = model.NewIntVar(0, availability_for_day, ID_VAR) model.Add(sum[intvars[intv] for intv in intvars.keys()]<= availability_for_day
The ID_VAR keys for intvars are an f-string combination between dates (yyyy-mm-dd) and employee_id. I want to add a constraint that allows me to set a minimum number of employees that are assigned for a task for each day. Therefore, my question is: how do I count how many intvars[intv] values are greater than zero? Then, how do I set the number of intvars[intv] that are greater than zero to be equal or greater than a minimum number of employees that I want to allocate?
So far, I have tried using another IntVar as a counter, but I could not make it work.