## 3 Model Description and Formulation
### A Mathematical Formulation for the New Truck Appointment System
#### 3.2.2 A Mathematical Model from the Perspective of the Terminal Operator  
The mathematical model (Model 2) for the terminal operator takes into account the penalties for the unassigned and unreserved slot capacity (the tasks a truck can reserve).  
\[\text{Minimize}\ \sum_{j}\sum_{k}\Bigg{\{}\frac{B_{jk}}{\sum_{j}\sum_{k}B_{jk}} \Big{(}B_{jk}-\ \sum_{i}s_{ijk}-Y_{jk}\Big{)}+\Big{(}Y_{jk}-\sum_{n}\sum_{i}X^{n}_{ijk} \Big{)}\Bigg{\}}. \tag{12}\]Subject to,  
\[\sum_{m}\sum_{i}X_{ijk}^{n}\leq Y_{jk}\text{ for all }j\text{ and }k; \tag{13}\] \[Y_{jk}\leq B_{jk}-\sum_{i}s_{ijk}\text{ for all }j\text{ and }k;\] (14) \[\sum_{j}Y_{jk}\leq g_{k}\text{ for all }k;\] (15) \[Y_{jk}\geq 0\text{ for all }j\text{ and }k. \tag{16}\]  
Equation (12) is an objective function that minimizes the sum of the penalties for the unassigned and unreserved slot capacity (the tasks a truck can reserve). The unassigned slot penalty is proportional to the maximum number of tasks for a yard crane (TC) in each yard block and time window. Equation (13) and Equation (14) are constraints, and each equation means a limit on the number of tasks a truck can reserve allocated by the terminal operator and the number of unassigned slots for the yard block and the time window. Equation (15) is a constraint, and the maximum number of trucks that can pass through the gate in each time window must be satisfied. Equation (16) represents the non-negative condition of the decision variable \(Y_{jk}\). In the mathematical model from the perspective of the terminal operator, we apply \(X_{ijk}^{n}\) as a parameter.  
2.3. A Mathematical Model from the Perspective of Cooperation between the Transport Companies (Forwarders) and the Terminal Operator  
The mathematical model (Model 3) for cooperation between the transport companies (forwarders) and the terminal operator is considered simultaneously by combining their respective models.  
\[\text{Minimize }\sum_{j}\sum_{k}\left[\begin{array}{c}\alpha\sum_{n}\left\{ \frac{\sum_{n}\sum_{i}X_{ijk}^{n}-1}{2}\sum_{i}X_{ijk}^{n}+r^{n}\frac{T+1}{2} \sum_{i\in\{in\{in\text{\emph{in}\text{in}\text{)}}\text{ }X_{ijk}^{n}\}}}{\sum_{j\in\{\text{\emph{in}\text{ }\text{in}\text{)}}\text{ }X_{ijk}^{n}\}}} \\ +\beta\left\{\frac{B_{jk}}{\sum_{\text{\emph{in}\text{}\text{in}\text{ }\text{ }\text{B}_{jk}}}}\left(B_{jk}-\sum_{i}s_{ijk}-Y_{jk}\right)+\left(Y_{jk}-\sum_ {n}\sum_{i}X_{ijk}^{n}\right)\right\}\end{array}\right]. \tag{17}\]  
Subject to,  
\[\sum_{k}X_{ijk}^{n}\geq w_{ij}^{n}\text{ for all }i,\text{ }j,\text{ and }n, \tag{18}\] \[\sum_{i}\sum_{j}X_{ijk}^{n}\leq v_{k}^{n}\text{ for all }k\text{ and }n,\] (19) \[\sum_{m}\sum_{i}X_{ijk}^{n}\leq Y_{jk}\text{ for all }j\text{ and }k,\] (20) \[Y_{jk}\leq B_{jk}-\sum_{i}s_{ijk}\text{ for all }j\text{ and }k,\] (21) \[\sum_{j}Y_{jk}\leq g_{k}\text{ for all }k,\] (22) \[X_{ijk}^{n},Y_{jk}\geq 0\text{ for all }i,\text{ }j,\text{ }k,\text{ and }n. \tag{23}\]  
Equation (17) is an objective function and reflects the weighted sum of the perspectives of the transport company (forwarder) (Equation (1)) and the terminal operator (Equation (12)). Equation (18) is a constraint, and the number of trucks of task type assigned by the transport company (forwarder) to the yard block must satisfy the number of tasks for the transport company (forwarder) of task type assigned to the yard block. Equation (19) is a constraint, and the number of trucks from the transport company (forwarder) available in time window must be satisfied. Equation (20) and Equation (21) are constraints, and each equation means a limit on the number of tasks a truck can reserve allocated by the terminal operator and the number of unassigned slots for the yard block and the time window. Equation (22) is a constraint, and the maximum number of trucks that can pass through the gate in each time window must be satisfied. Equation (23) represents the non-negative condition of the decision variable \(X_{ijk}^{n}\) and \(Y_{jk}\).