# Ship Scheduling Algorithm Based on Markov-Modulated Fluid Priority Queues
## 3 Problem Modeling and Algorithm Modeling
### Waiting Time Analysis
In scenarios with clear priority requirements, SSA-BMMFPQ better meets the operational efficiency requirements, as shown in Table 4.

#### 4.2.4 Comparison of Fixed and Dynamic Service Rates

In order to simulate the actual situation, the service rate is invoked according to different anchorage states to reduce the waiting times of ships. The dynamic process of peak periods is presented by changing the service rate. The average waiting times of ships under fixed and dynamic service rates are compared to evaluate the effect of the dynamic service rate strategy. A comparison of the cumulative average waiting times of different-priority ships under a fixed service rate and dynamic service rate in shown in Figure 8. This shows that the waiting time of low-priority ships decreases after about 2.5 h, and the cumulative average waiting time is almost unchanged. It also prevents the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Time/h** & **LP/1h** & **GA/h** & **RL/h** & **M/G/1/1/h** & **SSA-MMFPQ/h** \\ \hline
2.0 & 1.1469 & 1.3549 & 1.4283 & 1.1009 & 0.0000 \\
3.0 & 1.3231 & 1.3119 & 1.8670 & 1.8262 & 0.1007 \\
4.0 & 1.1448 & 1.2538 & 0.8210 & 1.4036 & 0.0649 \\
5.0 & 1.7354 & 1.3376 & 1.2456 & 1.2988 & 0.0427 \\
6.0 & 1.5107 & 1.1619 & 1.2848 & 2.3041 & 0.0283 \\
7.0 & 1.5774 & 1.5647 & 1.5394 & 2.4390 & 0.0189 \\
8.0 & 2.1336 & 1.6988 & 1.1943 & 1.1182 & 0.0127 \\
9.0 & 1.2751 & 1.5072 & 1.3714 & 2.1005 & 0.0085 \\
10.0 & 1.7618 & 1.3114 & 1.3985 & 1.8837 & 0.0058 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Data table of average waiting times under different strategies. Figure 7: Comparison of average waiting times under different strategies. situation in which low-priority ships have no resource service for a long time and increases the fairness. #### 4.2.5 Normal Priority Scheduling Versus Weighted Multi-Priority Scheduling

In the face of unique circumstances, emergency ships need to pass immediately, so the first time arrangement is needed, which requires weight setting for the priority of ships. For each time point \(t\), the weighted average waiting time of each priority level is summed according to the weight \(\mathbf{w}=[w_{1},w_{2},\cdots,w_{num\_classes}]\) to obtain the weighted average waiting time of the time point. The calculation formula is as follows:

\[\text{weighted}_{t}=\sum\limits_{i=1}^{num\_classes}w_{i}\times\text{waiting time}_{i,t}\]

SSA-BMMFPQ is used for both normal priority scheduling and weighted multi-priority scheduling. It can be seen from Figure 9 that, under the normal priority scheduling policy, due to the fixed priority order, ships still need to wait according to the fixed priority, resulting in longer average waiting times. Under the weighted multi-priority scheduling policy, the priority can be increased by increasing its weight, and the average waiting time can be reduced. Figure 8: Comparison of cumulative average waiting times under different service rate strategies: (a) priority 1; (b) priority 2; (c) priority 3. Figure 9: Comparison of average times with different priority configurations. ## 5 Conclusions

In this paper, the SSA-BMMFPQ algorithm is proposed to solve the problems of resource allocation and ship priority scheduling in a ship anchorage system. By analyzing the ship queue length and waiting time, the influence mechanism of the priority structure on system performance is clarified. Through experiments, its advantages in shortening the average waiting time and alleviating the detention of high-priority ships are verified, providing support for anchorage and port resource allocation. However, the algorithm has some limitations; for example, the priority weight setting is not dynamically coupled with the CTMC, it cannot respond to the real-time changes in state parameters such as the ship arrival rate, and the state transition rule does not consider the non-stationary fluctuations in the fluid input and service rate, failing to reflect the randomness of actual ship arrivals.