Constraints

The following constraints are used in this example:

  • bounds on variables

  • for $i \in \text {DEPOTS}$ and $j \in \text {DEPOTS}$ and $\text {day} \in \text {DAYS}$ and $\text {length} \in \text {LENGTHS}$,

    \[  \Variable{NumCarsRented[i,j,day,length]} = \Argument{transition\_ prob[i,j]} \cdot \Argument{length\_ prob[length]} \cdot \Variable{NumCarsRented\_ i\_ day[i,day]}  \]
  • for $i \in \text {DEPOTS}$ and $j \in \text {DEPOTS} \setminus \{ i\} $ and $\text {day} \in \text {DAYS}$,

    \[  \Variable{NumCarsTransferred[i,j,day]} = \Variable{NumUndamagedCarsTransferred[i,j,day]} + \Variable{NumDamagedCarsTransferred[i,j,day]}  \]
  • for $i \in \text {DEPOTS}$ and $\text {day} \in \text {DAYS}$,

    \begin{align*} & \Variable{NumUndamagedCarsStart[i,day]} \\ & = (1 - \Argument{damage\_ prob}) \cdot \sum _{\substack{j \in \text {DEPOTS},\\ \text {length} \in \text {LENGTHS}}} \Variable{NumCarsRented[j,i,day-length,length]} \\ & + \sum _{j \in \text {DEPOTS} \setminus \{ i\} } \Variable{NumUndamagedCarsTransferred[j,i,day-transfer\_ length]} \\ & + \Variable{NumDamagedCarsRepaired[i,day-repair\_ length]} \\ & + \Variable{NumUndamagedCarsIdle[i,day-1]} \end{align*}
  • for $i \in \text {DEPOTS}$ and $\text {day} \in \text {DAYS}$,

    \begin{align*} & \Variable{NumDamagedCarsStart[i,day]} \\ & = \Argument{damage\_ prob} \cdot \sum _{\substack{j \in \text {DEPOTS},\\ \text {length} \in \text {LENGTHS}}} \Variable{NumCarsRented[j,i,day-length,length]} \\ & + \sum _{j \in \text {DEPOTS} \setminus \{ i\} } \Variable{NumDamagedCarsTransferred[j,i,day-transfer\_ length]} \\ & + \Variable{NumDamagedCarsIdle[i,day-1]} \end{align*}
  • for $i \in \text {DEPOTS}$ and $\text {day} \in \text {DAYS}$,

    \begin{align*} & \Variable{NumUndamagedCarsStart[i,day]} \\ & = \Variable{NumCarsRented\_ i\_ day[i,day]} \\ & + \sum _{j \in \text {DEPOTS} \setminus \{ i\} } \Variable{NumUndamagedCarsTransferred[i,j,day]} \\ & + \Variable{NumUndamagedCarsIdle[i,day]} \end{align*}
  • for $i \in \text {DEPOTS}$ and $\text {day} \in \text {DAYS}$,

    \begin{align*} & \Variable{NumDamagedCarsStart[i,day]} \\ & = \Variable{NumDamagedCarsRepaired[i,day]} \\ & + \sum _{j \in \text {DEPOTS} \setminus \{ i\} } \Variable{NumDamagedCarsTransferred[i,j,day]} \\ & + \Variable{NumDamagedCarsIdle[i,day]} \end{align*}
  • $\displaystyle { \begin{aligned} [t] \Variable{NumCars} = \sum _{i \in \text {DEPOTS}} \bigg(& \Argument{length\_ prob[3]} \cdot \Variable{NumCarsRented\_ i\_ day[i,0]} \\ & + \sum _{\text {length}=2}^3 \Argument{length\_ prob[length]} \cdot \Variable{NumCarsRented\_ i\_ day[i,1]} \\ & + \Variable{NumUndamagedCarsStart[i,2]} + \Variable{NumDamagedCarsStart[i,2]}\bigg) \end{aligned} }$