# Deriving Situation-Adaptive Policy for Container Stacking in an Automated Container Terminal
## 4 Stacking Policy Based on Scoring Functions  
This section describes the stacking policies proposed by [4; 6]. The stacking location of an incoming container is determined in two stages. First, the container is assigned to a \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Characteristics**} & \multicolumn{5}{c}{**Related References and Their Characteristics**} \\ \cline{2-6}  & [1; 2; 3; 16; 17; 18; 21; 22; 23; 24] & [19; 20] & [4; 6] & [5] & **Proposed Method** \\ \hline Rule-based & Yes & Yes & No & No & No \\ Score-based & No & No & Yes & Yes & Yes \\ Optimized & No & Yes & Yes & Yes & Yes \\ Situation adaptive & No & No & No & Yes & Yes \\ Reactive to changes & No & No & No & No & Yes \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of the proposed method with the related works that determine the stacking locations for individual containers. block in the storage yard taking into account various operational conditions in all of the blocks. Second, a specific location within the assigned block is selected from among the candidate locations based on several criteria such as the distance to the destination, the stack height, the likelihood of rehandling, and so on. The stacking policies described in this paper are used in the second stage to determine a specific stacking location within the designated block. To determine a stacking location within a block, all the available slots in the block are evaluated by using a scoring function and then the one with the best score is chosen. Note that the slot determination is required not only for the containers newly coming into the block but also for those that are rehandled or repositioned within the block. Furthermore, a good target slot can be different depending on whether the container is an inbound, an outbound, or a transshipment container. Table 2 shows that the stacking policy uses different scoring functions for different container types. The score \(s_{i}(x)\) of a slot \(x\) for the \(i\)th container type is calculated by the weighted sum given below:  
\[s_{i}(x)=\sum_{i}w_{i,j}C_{i,j}(x) \tag{1}\]  
where \(C_{i,j}(x)\) is the evaluation value of slot \(x\) according to the \(j\)th criterion for the \(i\)th container type and \(w_{i,j}\) is the weight for \(C_{i,j}\). The stacking policy of Table 2 consists of seven scoring functions, each of which employs a different subset of eight criteria. Notice that the decision by the policy may change as the values of the weights of the criteria change. The criterion \(D_{to}\) is the distance to the candidate stacking location from the current location of the target container, and \(D_{from}\) is the distance from the candidate location to the outgoing HP of the container. These two criteria are calculated differently for different types of containers, as illustrated in Figure 2. \(D_{lo}\) and \(D_{from}\) give the same value if the target container is a transshipment container. \(H\) is the height of the stack underneath the candidate location. The higher the stack, the greater the likelihood of rehandling. \(E\) is an indicator of whether or not the candidate location is an empty ground. The empty grounds have to be saved as much as possible in preparation for the possible shortage of stacking locations. \(S\) is the amount of reduction in empty ground slots available for container stacking. For safety reasons, containers of different sizes cannot be stacked together. A 40 ft container occupies two adjacent stacks, as shown in Figure 1. Therefore, placing a 20 ft container on one of the two consecutive empty ground slots not only uses one ground slot for a 20 ft container but also reduces the availability of ground slots for 40 ft containers.