# A Study on the Design and Control of the Overhead Hoist Railway-Based Transportation System
## 4 Control Algorithms
### Find a New Location for the Shuttles
#### 4.4.3 A Method for Finding a Solution  
As for the logical mathematics, the system is located in hospitals to deliver drugs or items from different warehouses to customers. The processing of orders should be prioritized according to first-in-first-out approach. The shuttles with higher priority will be given priority to choose the travel route first because they are fulfilling the required orders first. The algorithm will calculate the \(t_{0}\):  
Step 1: Find the shortest ways for the shuttles to complete their tasks. The rail system can be considered a closed circle. The shortest route from A to B can be found by simply examining which AB arc is shorter. Step 2: From the highest priority to the lowest priority, the shuttle should proceed to choose its route according to the rule that the lower priority shuttle must check the route of the higer priority chuttles and choose its route so as to make the \(E_{i}(t_{0})\) as minimal as possible or, more precisely, to save most the battery. To reduce the complexity of the algorithm, we decided that the shuttle with the highest priority is always guaranteed to take the shortest distance at all times. Figure 13 and Table 7 show the directions taken by shuttles I, II and III to complete their tasks. At that moment, the energy which will be consumed to complete three tasks is \(E\). The system in Figure 12 includes just three shuttles, so \(E(t_{0})=E_{I}(t_{0})+E_{II}(t_{0})+E_{III}(t_{0})\). \(E_{I}^{0}\), \(E_{II}^{0}\), and \(E_{III}^{0}\) denote the least amount of energy consumed for shuttles I, II, III to complete their tasks. The system is currently set up such that the cars always adjust at the same speed, so \(v_{I}=v_{II}=v_{III}=v_{0}\). If Shuttle A or B decides to run in a direction other than the shortest, the \(E_{I}(t_{0})\geq E_{I}^{0}(t_{0})\), \(E_{II}(t_{0})\geq E_{II}^{0}(t_{0})\), \(E_{III}(t_{0})\geq E_{III}^{0}(t_{0})\). So \(E(t_{0})\geq E_{I}^{0}(t_{0})+E_{II}^{0}(t_{0})+E_{III}^{0}(t_{0})\). The \"=\" appears when \(E_{I}(t_{0})=E_{I}^{0}(t_{0})\), \(E_{II}(t_{0})=E_{II}^{0}(t_{0})\), \(E_{III}(t_{0})=E_{III}^{0}(t_{0})\). This means the shuttles I, II and III have just two options: \begin{table}
\begin{tabular}{l l l} \hline \hline
**Priority** & **Status of Shuttles** & **Operation** \\ \hline
1 & I & To deliver at Staion 1 \\
2 & II & To deliver at Station 2 \\
3 & III & To acquire goods at Station 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: The mission and priority of shuttles I, II, and III. Figure 13: Illustration of the position of three shuttles. Keep running and allow for the shortest direction;  
2. Remain standing. For here, from the highest priority to the lowest priority, the Shuttle I chooses the direction first. Next to it is the Shuttle II, and the last is the Shuttle III. Moreover, Shuttle I is the highest priority shuttle, so its route is the shortest route to complete its task. In Figure 14, the \(\Delta T_{\text{maximum}}\) is 7, and the shortest route to end the task of Shuttle I comes from A-> B-> C-> -> H, which is the chosen route of the Shuttle, so \(E_{I}(t_{0})=E_{I}^{0}(t_{0})\). Next is Shuttle II. It must compare its shortest route with the route of Shuttle I (the shuttle with the higher priority). From time 0 to time 7, there are instances of \"no stuck\" occuring between Shuttle II and I, so the decision of Shuttle II is to run and the route of Shuttle II is setup: \(E_{II}(t_{0})=E_{II}^{0}(t_{0})\). The last is Shuttle III. It must check the route of Shuttle I and II. However, between time 5 and time 6, the shortest route of Shuttle III coincides with the route of Shuttle 1. So, to make \(E_{III}(t_{0})=E_{III}^{0}(t_{0})\), Shuttle III's only option is to remain standing. Finding the station to avoid: The majority of the freight process occurs in situations where the shuttles meet without any other stations to avoid. The reason for this is that the number of main stations and substations required to avoid each other is very small and the actual travel distance is very large (maybe 5-10 km).