Good evening, I have the following problem. I want to create a duty roster and model performance losses. For this I have introduced the binary variable $l_{it}$, which takes the value 1 when the shift of a worker changes, e.g. from late to early shift. Now I have introduced the performance variable $p_{it}$, which starts from 1 and should deteriorate with changes of view. The performance should deteriorate by 0.1 from the second shift change, i.e. from the second time $l_{it}=1$. For each further time $l_{it}=1$ again by 0.1. How do I model the whole thing, so that it comes only from the second time to a loss. That would be my suggestion so far:
$$p_{it}=\begin{cases} p_{it_{-1}}-0.1\times l_{it}, & \text{if}~\sum_{t=2}^{t}l_{it}\ge 2~~~~\forall i\in I,\\ p_{it_{-1}}, & \text{else.} \end{cases} $$
In each period, for each worker, the sum of all $l_{it}$, starting from $t=2$ up to the current period, should be calculated. If this sum is $\ge2$, then the 1st case should occur, if not then the second. How do I model this? Or is my formulation correct?
If I understand what you want, and if higher performance values are always more desirable, you can add the following constraints for all $i$ and $t:$ $$p_{i,t} \le 1$$ and $$p_{i,t} \le 1.1 - 0.1\cdot \sum_{\tau=2}^t \ell_{i,t}.$$
If, for some reason, lower performance values would improve the objective function (giving the solver an incentive to underestimate $p$), things get more complicated.
Addendum: This only works if we can be sure that at most 11 shift changes can occur over the planning horizon. Assuming $p_{i,t}$ is defined to be nonnegative, the second constraint will indirectly force $\sum_{\tau=2}^t \ell_{i,t} \le 11$ for all $t.$