# 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
Second turn: Shuttle 2 has not been set the travel direction and it has the highest priority among the remaining shuttles and the details of all the shuttles after the second turn are shown in the Table 11  
Step 1: The nearest direction to D is counter-clockwise;  
Step 2: Following the counter-clockwise direction, the next shuttle is Shuttle 3 but the distance between Shuttle 3 and Shuttle 2 is bigger than \"safe distance\", so the \"group of Shuttle 2\" has Shuttle 2 only;  
Step 3: If \"group of Shuttle 2\" moves, the shuttles will not collide with each other. Shuttle 1 is of the higher priority and it can collide with Shuttle 2 if it still moves in clockwise-direction. However, it will finish its work before meeting Shuttle 1. So, Shuttle 2's direction is set to counter-clockwise. Third turn: Shuttle 3 has not been set the travel direction and it has the highest priority among the remaining shuttles and the details of all the shuttles after the third turn are shown in the Table 12  
Step 1: The nearest direction to F is counter-clockwise. Step 2: Following the counter-clockwise direction, the next shuttle is Shuttle 4 and the distance between Shuttle 3 and Shuttle 4 is smaller than the \"safe distance\", so the \"group of Shuttle 3\" has Shuttle 4. Next to Shuttle 4 is Shuttle 7, and the distance between them is smaller than the \"safe distance\"; therefore, Shuttle 7 is added into \"group of Shuttle 3\". The shuttle next to Shuttle 7 is Shuttle 6 but the distance between them is bigger than the \"safe distance\" so it is not added in the \"group of shuttle 3\". Step 3: If \"group of Shuttle 3\" moves, the shuttles will not collide with each other. Shuttle 2 has the same direction with \"group of Shuttle 3\" so it will not \"stuck\" with \"group of Shuttle 3\". Shuttle 1 has the opposite direction, but it will finish before running into \"group of Shuttle 3\". So all the shuttles in \"group of Shuttle 3\" are set to clockwise, and the priorities are the same as that of Shuttle 3. \begin{table}
\begin{tabular}{l l l l l} \hline
**Priority** & **Shuttle** & **State of Shuttle** & **Mission** & **Direction** \\ \hline
1 & 1 & Need charge shuttle & Go charge at Station A & Clockwise \\
2 & 2 & Delivery shuttle & Delivery at Station D & Not set \\
3 & 3 & Delivery shuttle & Delivery at Station F & Not set \\
4 & 4 & Free shuttle & Get good at Station E & Not set \\
5 & 5 & Free shuttle & Get good at Station B & Not set \\
6 & 6 & Free shuttle & Don’t have mission & Not set \\
7 & 7 & Free shuttle & Don’t have mission & Not set \\ \hline \end{tabular}
\end{table} 
Table 10: Details of all the shuttles after the first turn. \begin{table}
\begin{tabular}{l l l l l} \hline
**Priority** & **Shuttle** & **State of Shuttle** & **Mission** & **Direction** \\ \hline
1 & 1 & Need charge shuttle & Go charge at Station A & Clockwise \\
2 & 2 & Delivery shuttle & Delivery at Station D & Counter-clockwise \\
3 & 3 & Delivery shuttle & Delivery at Station F & Not set \\
4 & 4 & Free shuttle & Get good at Station E & Not set \\
5 & 5 & Free shuttle & Get good at Station B & Not set \\
6 & 6 & Free shuttle & Don’t have mission & Not set \\
7 & 7 & Free shuttle & Don’t have mission & Not set \\ \hline \end{tabular}
\end{table} 
Table 11: Details of all the shuttles after the second turn. Fourth turn: Shuttle 5 has not been set the travel direction and it has the highest priority among the remaining shuttles and the details of all the shuttles after the fourth turn are shown in the Table 13  
Step 1: The nearest direction to B is clockwise. Step 2: Following the clockwise direction, the next shuttle is Shuttle 6, but the distance between Shuttle 5 and Shuttle 6 is bigger than the \"safe distance\". So, \"Group of shuttle 5\" has Shuttle 5 only. Step 3: If \"group of shuttle 5\" moves, the shuttle will collide with those of \"group of Shuttle 2\".