# Deriving Situation-Adaptive Policy for Container Stacking in an Automated Container Terminal
## 7 Cases with Multiple Situation Indicators  
Thus far, we have been assuming that the seaside workload is the only indicator we consider to represent the situation. Although rare practically in container terminals, we can imagine the cases in which the situation is represented by multiple indicators. Our method described in Section 5 can be extended to cover such cases by generalizing the interpolation to a weighted average of multiple relevant terms. Consider, for simplicity of explanation, the case with two indicators \(s_{1}\) and \(s_{2}\). We need two threshold values for each indicator to distinguish between very low and very high values, i.e., \(\theta_{1,l}\) and \(\theta_{1,h}\) for \(s_{1}\), and \(\theta_{2,l}\) and \(\theta_{2,h}\) for \(s_{2}\). This leads to four extreme or boundary situations \(B_{1,l}\), \(B_{1,h}\), \(B_{h,l}\), and \(B_{h,h}\), where \(B_{1,l}\) is the set of situations with \(s_{1}\leq\theta_{1,l}\) and \(s_{2}\leq\theta_{2,l}\), \(B_{1,h}\) with \(s_{1}\leq\theta_{1,l}\) and \(s_{2}\geq\theta_{2,h}\), \(B_{h,l}\) with \(s_{1}\geq\theta_{1,h}\) and \(s_{2}\leq\theta_{2,l}\), and \(B_{h,h}\) with \(s_{1}\geq\theta_{1,h}\) and \(s_{2}\geq\theta_{2,h}\). We use \(\pi_{l,l}\), \(\pi_{l,h}\), and \(\pi_{h,h}\) to denote the policies specialized for the boundary situations \(B_{1,l}\), \(B_{1,h}\), \(B_{h,l}\), and \(B_{h,h}\), respectively. Given an intermediate situation \(s\) other than those boundary situations, the policy \(\pi_{s}\) for \(s\) can be synthesized from \(\pi_{l,l}\), \(\pi_{l,h}\), \(\pi_{h,l}\), and \(\pi_{h,h}\) by taking a weighted average after normalizing the indicator values. The normalization is necessary to compensate the different scales of different indicators. Figure 6 represents the space of all situations on a two-dimensional plane formed by two coordinates, one for indicator \(s_{1}\) and the other for indicator \(s_{2}\). We can see how the areas of the four boundary situations \(B_{1,l}\), \(B_{1,h}\), \(B_{h,l}\), and \(B_{h,h}\) are located in relation to the threshold values of the two indicators. \(A\) and \(B\) in the figure are two situations other than the boundary situations. \(A\) is an intermediate situation whose indicator values do not go over any threshold. \(B\) is not quite an intermediate situation because one of its indicator \(s_{2}\) takes a value below the lower threshold \(\theta_{2,l}\). Figure 6 shows the situations in Figure 6 after a normalization, where each indicator value \(s_{i}\) is transformed to \((s_{i}-\theta_{i,l})/(\theta_{i,h}-\theta_{i,l})\). In Figure 6, the areas of boundary situations are marked by the corresponding policies, and the distances to those areas from \(A\) and \(B\) are indicated by \(d_{ij}\)'s. Let \(\pi_{A}\) denote the policy for situation \(A\) in the figure. Then, the score \(\pi_{A}(x)\) for a candidate slot \(x\) in situation \(A\) can be calculated by a weighted average of the scores given by \(\pi_{l,l}\), \(\pi_{l,h}\), \(\pi_{h,l}\), and \(\pi_{h,h}\):  
\[\pi_{A}(x)=\frac{\frac{1}{d_{1,l}(A)}\pi_{l,l}(x)+\frac{1}{d_{1,h}(A)}\pi_{l,h }(x)+\frac{1}{d_{h,l}(A)}\pi_{h,l}(x)+\frac{1}{d_{h,h}(A)}\pi_{h,h}(x)}{\frac {1}{d_{1,l}(A)}+\frac{1}{d_{1,h}(A)}+\frac{1}{d_{h,l}(A)}+\frac{1}{d_{h,l}(A) }+\frac{1}{d_{h,l}(A)}} \tag{5}\]  
where \(d_{i,j}(A)\) is the distance from \(A\) to the area of \(\pi_{i,j}\), and \(1/d_{i,j}\) can be interpreted as the respective closeness. If \(\pi_{B}\) denotes the policy for situation \(B\), the score \(\pi_{B}(x)\) for a candidate slot \(x\) in situation \(B\) can be similarly calculated as  
\[\pi_{B}(x)=\frac{\frac{1}{d_{-j}(B)}\pi_{l,l}(x)+\frac{1}{d_{-j}(B)}\pi_{h,l} (x)}{\frac{1}{d_{-j}(B)}+\frac{1}{d_{-h}(B)}} \tag{6}\]  
where terms related to \(\pi_{l,h}\) and \(\pi_{h,h}\) are not included because \(s_{2}\) is extremely low in \(B\) and thus they are irrelevant. Note that Equation (6) is equivalent to the linear interpolation we calculated in Equation (3).