# Ship Scheduling Algorithm Based on Markov-Modulated Fluid Priority Queues
## 3 Problem Modeling and Algorithm Modeling
### Waiting Time Analysis
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Parameter Category** & **Value** & **Implication** \\ \hline Service rate & d = 4 & Number of ships served by anchorage \\ Arrival rate matrix of the first & \(\mathbf{R}^{(1)}=\begin{bmatrix}1&&\\ &0&\\ &&2&\\ &&&1\end{bmatrix}\) & The arrival rate of Class 1 ships is such that the first 1 indicates that, in the first condition, Class 1 ships arrive at 1 ship per hour; 2 indicates that, in the third condition, Class 1 ships arrive at 2 ships per hour, etc. \\ Arrival rate matrix of the second & \(\mathbf{R}^{(2)}=\begin{bmatrix}2&&\\ &0&\\ &&4&\\ &&&1\end{bmatrix}\) & As above \\ Arrival rate matrix of the first & \(\mathbf{R}^{(2)}=\begin{bmatrix}4.5&&\\ &&1&\\ &&0&\\ &&&2\end{bmatrix}\) & As above \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Experimental parameters. ### Analysis of Experimental Results

#### 4.2.1 Cumulative Distribution Function (CDF) of Waiting Time for Different Priority Tasks

CDF curves are used to compare the waiting times for ships of different priority classes. In Figure 3, we can see that the curve for priority 3 rises significantly faster than that for priority 1 and priority 2, indicating that priority 3 ships have shorter waiting times. Comparing the relative positions of the priority curves, the curves with the higher-priority ships above in Figure 4 generally have shorter waiting times. Focusing on the region with long waiting times, if the cumulative distribution function of a priority increases slowly, it indicates that there are more ships in the priority class that need to wait for a long time, and the scheduling strategy of the priority ships can be optimized or the related resource allocation can be increased. 2.2 Influence of Anchorage Utilization Rate and Scale of Number of Ships on Computational Execution Time

Under the same conditions, the anchor utilization ratios were set to 0.1, 0.5, and 0.9, respectively. Figure 5 shows that the computational execution time increases significantly as the number of ships increases. As the number of ships increases from smaller to larger, the computational execution time may rise. When the anchorage utilization rate increases, the computational execution time may also increase, as shown in Figure 5.

Figure 4: Comparison of CDFs: (**a**) priority 1; (**b**) priority 2. Figure 3: Comparison of CDFs of priority 1 with those of priority 2 and priority 3. #### 4.2.3 Comparison of Scheduling Strategies

Under the M/M/1 strategy, high-priority ships may still wait longer in some cases due to the inherent queuing rules of the system, which affects the overall efficiency. SSA-BMMFPQ, by virtue of its preferential treatment of high-priority ships, can significantly reduce the waiting times of high-priority ships, thereby improving the overall operational efficiency. Figure 6 shows a comparison of the average waiting times of M/M/1 and SSA-BMMFPQ at different priority levels. At most time points, the average waiting time of SSA-BMMFPQ is lower than that of the M/M/1 strategy. This shows that SSA-BMMFPQ has a greater advantage than the M/M/1 strategy in most scenarios, especially in the case of strict operational efficiency requirements, and can better meet actual operational requirements. Figure 7 compares the average waiting times of LP, GA, RL, M/G/1/1, and SSA-BMMFPQ. The results show that SSA-BMMFPQ has the shortest average waiting time. LP has poor flexibility, GA is affected by randomness, RL has a time delay in dealing

Figure 5: Influence of anchorage utilization rate on calculation execution time. Figure 6: Comparison of average waiting times between M/M/1 and SSA-BMMFPQ. with complex scenes, and all three perform poorly. M/G/1/1 fluctuates significantly due to insufficient priority consideration. SSA-BMMFPQ can be dynamically sequenced, is adaptable, and effectively reduces the waiting time. SSA-BMMFPQ enables high-priority ships to receive service first through reasonable priority scheduling, effectively reducing the waiting times of high-priority ships.