# Deriving Situation-Adaptive Policy for Container Stacking in an Automated Container Terminal
## 5 Proposed Method
When we use a GA to search for the two boundary policies, we simultaneously search for the two threshold values to quantify the two fuzzy terms'very low' and'very high'. Let \(s\) represent the current workload that is measured by adding up the estimated processing times of all the vessel jobs scheduled to be done by the seaside ASC within the next horizon of length \(h\) seconds from the current point of time. A vessel job is either a loading or an unloading job. For a loading job, the seaside ASC makes an empty trip from its current location to the location of the target container, picks up the container, makes a loaded trip to a seaside HP, and puts the container down on top of an AGV waiting there. Among these actions, container pickup can take longer if it involves rehandlings. For an unloading job, the seaside ASC undertakes an empty trip from its current location to the seaside HP where the AGV bringing the target container is parked, picks up the container from the AGV, undertakes a loaded trip to the designated stacking location, and puts the container down at that location. Since the loading and unloading schedules for each vessel are predetermined at the planning stage well before the real operation starts, the workload of vessel operations within a horizon can be easily estimated. We use \(\theta_{l}\) and \(\theta_{h}\) to denote the threshold values for the extreme or boundary workloads; the workload is said to be very low if \(s\leq\theta_{l}\) and very high if \(s\geq\theta_{h}\). The seaside ASC is said to be overloaded if \(s>h\), as the time taken to finish the works planned for the horizon exceeds the length of the horizon. Let \(\pi_{l}\) and \(\pi_{h}\) be the policies specialized for the situations of very low workload and very high workload, respectively. Then, the policy \(\pi_{s}\) for workload \(s\) with \(\theta_{l}<s<\theta_{h}\) can be synthesized from \(\pi_{l}\) and \(\pi_{h}\) by deriving new weight values to be used in the scoring functions of \(\pi_{s}\) through interpolations between the corresponding weights in  
a candidate slot \(x\) by the synthesized policy \(\pi_{s}\) can be directly calculated from the scores \(\pi_{l}(x)\) and \(\pi_{h}(x)\) as  
\[\pi_{s}(x)=\frac{(\theta_{h}-s)\pi_{l}(x)+(s-\theta_{l})\pi_{h}(x)}{\theta_{h}- \theta_{l}} \tag{3}\]  
without actually deriving the individual weights constituting \(\pi_{s}\) because the values \(\theta_{h}\), \(\theta_{l}\), and \(s\) in Equation (2) are independent of \(i\). We use a GA for our optimization, which is basically the same as that used in [4]. We optimize not only \(\pi_{l}\) and \(\pi_{h}\) but also the two threshold values \(\theta_{l}\) and \(\theta_{h}\). Figure 4 shows the representation of the candidate solution adopted by our GA. Since each policy consists of 40 weights after dropping out the criterion \(P\), there are 82 real values to be optimized in total, where \(v_{l}\) and \(v_{h}\) are constrained to be in \([0,2]\) and the weight values in [-1, 1]. During the evaluation, \(v_{l}\) and \(v_{h}\) are decoded to \(\theta_{l}\) and \(\theta_{h}\), respectively, by having them multiplied to the length of horizon \(h\). The reason for setting the upper bound of \(v_{l}\) and \(v_{h}\) to 2 is that the workload of vessel operation measured in time can exceed the length of the horizon when overloaded. To evaluate a candidate policy during the search, the policy is applied through simulation to a set of scenarios randomly chosen from the provided pool and the resulting performances are averaged. The pool contains various scenarios of different difficulty levels; a scenario is difficult if the workloads of the ASCs are high. The length of a scenario is three weeks, which is long enough to measure the efficiency of the ASC operation because enough of the containers that arrived during this period are retrieved. During the first two weeks, the stacking yard, or block, is initialized starting from an empty yard without simulating the ASC's movements.