# Deriving Situation-Adaptive Policy for Container Stacking in an Automated Container Terminal
## 4 Stacking Policy Based on Scoring Functions
\begin{table}
\begin{tabular}{c c c c} \hline \multicolumn{2}{c}{**Container Type**} & \multicolumn{3}{c}{**Scoring Function**} \\ \hline \multirow{3}{*}{Incoming} & Inbound & \(s_{1}=w_{1}D_{lo}+w_{2}D_{from}+w_{3}H+w_{4}E+w_{5}S\) \\  & Outbound & \(s_{2}=w_{6}D_{to}+w_{7}D_{from}+w_{8}H+w_{9}E+w_{10}S+w_{11}G+w_{12}P\) \\  & Transship & \(s_{3}=w_{13}D_{to}+w_{14}H+w_{15}E+w_{16}S+w_{17}G\) \\ \hline \multirow{3}{*}{Rehandle} & Inbound & \(s_{4}=w_{18}D_{lo}+w_{19}D_{from}+w_{20}H+w_{21}E+w_{22}S\) \\  & Outbound and Transship & \(s_{5}=w_{23}D_{to}+w_{24}D_{from}+w_{25}H+w_{26}E+w_{27}S+w_{28}G\) \\ \hline \multirow{3}{*}{Reposition} & Inbound & \(s_{6}=w_{29}D_{to}+w_{30}D_{from}+w_{31}H+w_{32}E+w_{33}S+w_{34}T\) \\  & Outbound and Transship & \(s_{7}=w_{35}D_{to}+w_{36}D_{from}+w_{37}H+w_{38}E+w_{39}S+w_{40}G+w_{41}T\) \\ \hline \end{tabular}
\end{table} 
Table 2: Scoring function for each of the seven container types. \(T\) indicates whether or not the container right underneath the candidate location has been temporarily repositioned to that slot. \(T\) is used only in the scoring functions for the containers to be repositioned. Since a repositioned container will soon be moved to an outgoing HP, rehandling is quite likely to occur if there is some other container on top of it. However, if the container on top of it is also a repositioned container, rehandling can be avoided by simply moving the upper one to its own outgoing HP before moving the lower one. Criterion \(T\) encourages the repositioned containers to be kept together in the same stacks. This is desirable to save stacking slots available for the containers newly coming in or for those rehandled. \(G\) is the estimated likelihood of the occurrence of rehandling when a container to be loaded to a vessel is stacked on top of others. If the container was just stacked and all the containers underneath belong to the same category, no rehandling occurs during loading. Otherwise, the underneath containers belonging to different categories can cause rehandlings. As mentioned before, the containers belonging to the same category are to be loaded onto the same vessel, have the same port of destination, are of the same size, and are of the same weight class. \(P\) appears only in the scoring function \(s_{2}\), which is specialized for the outbound containers brought in by the ETs. It is the preference value of a candidate location depending on which region of the block the location belongs to. It is preferable that the outbound containers to be loaded sooner are stacked closer to the seaside. Figure 3 illustrates the distributions of the preferences over different regions in a block for the outbound containers of different loading times. The block is divided into five regions, and there are three different urgency levels for loading. The preferences are distributed differently for each urgency level, resulting in fifteen preference values each for a region and an urgency level. In the previous work [6], these preference values as well as all the weight values in Table 2 were determined by running a GA-based search algorithm. Figure 2: \(D_{to}\) and \(D_{from}\) depending on the type of container. Table 3 summarizes the eight criteria explained above. To calculate the weighted sum of the respective subsets of these criteria, the policy of Table 2 uses 41 weights. The evaluation values of all the criteria are normalized to [0, 1] and the weight values are constrained to [-1, 1]. Note that a weight can be negative if the value of the corresponding criterion affects the policy adversely. As the decision made by the policy depends on the weight combination or the weight vector, the weight vector is considered as the policy. When the policy is optimized by using a GA, each candidate policy is evaluated by applying it to a variety of scenarios of operations in a block and averaging the resulting performances. In this way, the optimization algorithm derives a policy that works the best on average.