## 4 Methodology
### Optimization Model Formulation
#### 4.2.3 Variables  
The following set of variables is meant to allow the sequencing of orders into their respective machines.  
* \(x_{l}^{o}:\begin{cases}1&\text{if order $o$ is assigned to line $l$}\\ 0&\text{otherwise}\end{cases}\)
* \(S_{o}^{F}\): Start time of filtering for order \(o\).
* \(C_{o}^{F}\): Completion time of filtering for order \(o\).
* \(S_{o}^{B}\): Start time of bottling for order \(o\).
* \(C_{o}^{B}\): Completion time of bottling for order \(o\).
* \(\delta_{op}^{F}:\begin{cases}1&\text{if order $o$ precedes $p$ on their assigned filtering machine}\\ 0&\text{otherwise}\end{cases}\)
* \(\delta_{op}^{B}:\begin{cases}1&\text{if order $o$ precedes $p$ on their assigned bottling machine}\\ 0&\text{otherwise}\end{cases}\)  
This set of variables include the assignation of orders to the machines at different stages, allowing for changeover in reassignation.  
* \(c_{op}^{F}=\left\{\begin{array}{ll}1&\text{if a changeover is needed between orders $o$ and $p$}\\ &\text{on their assigned filtering machine}\\ 0&\text{otherwise}\end{array}\right.\)
* \(c_{op}^{B}=\left\{\begin{array}{ll}1&\text{if a changeover is needed between orders $o$ and $p$}\\ &\text{on their assigned bottling machine}\\ 0&\text{otherwise}\end{array}\right.\)
* \(y_{of}=\left\{\begin{array}{ll}1&\text{if order $o$ uses filtering machine $f$}\\ 0&\text{otherwise}\end{array}\right.\)
* \(z_{ob}=\left\{\begin{array}{ll}1&\text{if order $o$ uses bottling machine $b$}\\ 0&\text{otherwise}\end{array}\right.\)
* \(m_{op}^{F}=\left\{\begin{array}{ll}1&\text{if a machine pairing changeover is needed from order $o$}\\ &\text{to $p$ on filtering machines}\\ 0&\text{otherwise}\end{array}\right.\)
* \(m_{op}^{B}=\left\{\begin{array}{ll}1&\text{if a machine pairing changeover is needed from order $o$}\\ &\text{to $p$ on bottling machines}\\ 0&\text{otherwise}\end{array}\right.\)  
Finally, the following is the set of variables necessary to address the sequence-dependent setup times, respectively, on the filtering and bottling machines. Also, for each one of the setup tasks needed for each possible SKU, the transition auxiliary decision variables are defined.  
* **Setup Variables**
* \(SU_{op}^{b}:\) Setup time from order \(o\) to \(p\) in bottling machine \(b\).
* \(SU_{op}^{L}:\) Setup time from order \(o\) to \(p\) in filtering machine \(f\).
* \(\delta_{color}^{op}:\begin{cases}1&\text{if color set up is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\)\[- \delta^{op}_{complexity}:\begin{cases}1&\text{if complexity set up is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\] \[- \delta^{op}_{bottle}:\begin{cases}1&\text{if bottle changeover is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\] \[- \delta^{op}_{height}:\begin{cases}1&\text{if bottle height set up is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\] \[- \delta^{op}_{diameter}:\begin{cases}1&\text{if bottle diameter set up is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\] \[- \delta^{op}_{filter}:\begin{cases}1&\text{if filtering requirement set up is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\] \[- \delta^{op}_{packaging}:\begin{cases}1&\text{if packaging set up is required from order $o$ to $p$}\\ 0&\text{otherwise}\end{cases}\]  
The objective function seeks to minimize the maximum completion time of the bottling machine i.e., the last stage of production process. This means it accounts for all possible combinations of batch assigning with setup and changeover and, while minimizing the makespan of the production plan, it also minimizes the necessary adjustments during the daily-planning horizon.