## 3 Four-Dimensional Dynamic Cooperative Path Planning Algorithm
### Dynamic Priority RRT* Algorithm
Table 3 shows the shortest cooperation time for 4D cooperative replanning. See Table 4 for the deviation ratio between the actual path length obtained by the 4D cooperative path algorithm and \(l_{\rm co}\). \begin{table}
\begin{tabular}{c c c c} \hline  & & **Center** & **Radius** \\ \cline{3-4}  & & 1:(100, 80, 0) & 35 \\
**Rader** & & 2:(100, 350, 5) & 35 \\  & & 3:(170, 230, 20) & 35 \\  & & 4:(280,200,20) & 35 \\ \hline \multirow{4}{*}{**Missile**} & **Center** & **Radius** & **Height** \\ \cline{2-4}  & & 1:(70, 170, 0) & 30 & 40 \\  & & 2:(170, 140, 0) & 30 & 40 \\ \cline{2-4}  & \multirow{4}{*}{**Artillery**} & **Center** & **Radius** & **Height** \\ \cline{3-4}  & & 1:(300, 100, 0) & 30 & 40 \\  & & 2:(260, 180, 0) & 25 & 40 \\ \cline{2-4}  & \multirow{4}{*}{**No-fly Tower**} & **Center** & **Radius** & **Height** \\ \cline{3-4}  & & 1:(200, 290, 10) & 15 & 50 \\  & & 2:(100, 275, 10) & 20 & 40 \\ \cline{2-4}  & \multirow{4}{*}{**No-fly Tower**} & **Center** & **Speed** & **Moving direction** & **Appearing time** \\ \cline{3-4}  & **Sudden** & **(t = 0)** & & Rotate 45\({}^{\circ}\) \\ \cline{3-4}  & & (110.5, 300, 0) & 3 m/s & counterclockwise \\ \cline{3-4}  & & & along the X-axis & \\ \hline \multirow{4}{*}{**UAVs**} & **Start position** & **Goal position** & **Speed** \\ \cline{2-4}  & **UAV 1** & (40, 40, 40) & & 19.91 m/s \\ \cline{1-1}  & **UAV 2** & (40, 200, 40) & & 20 m/s \\ \cline{1-1}  & **UAV 3** & (40, 360, 40) & & 18.53 m/s \\ \hline \end{tabular}
\end{table} 
Table 1: Normal Scenario. It can be seen in Figures 3-6 that, under the guidance of the HPAF algorithm of the local anti-collision planning layer, UAV3 is able to evade sudden moving threats. It should be noted that the path of UAV2 in Figure 6 shows that the moving threat could involve a collision. However, HAPF is an online planning algorithm. Each time a collision avoidance path in a unit time step is planned, the UAV flies along the planned path. When UAV3 has flown for 6 s, it reaches the path node with coordinates [147.6170, 326.0181, 49.2858]. When \(t=6\) s, the path node avoids the moving threat, so there is no collision. Finally, after 7.59 s of flight, UAV3 reaches the sub-target node; that is, the preplanned path node [157; 296; 50]. When \(t=7.59\) s, UAV3 has completed the avoidance of the moving threats. While UAV 2 evades the sudden moving threat, other UAVs fly along the initial cooperative path. At this point, the 4D cooperative planning layer comes into play. It can be seen in Table 3 that the shortest cooperation time is 12.22 s. Based on this, the \(l_{\text{co}}\) of each UAV can be obtained to ensure time coordination. It can be seen in Figure 7 that after HAPF is used to circumvent the sudden moving threat, the proposed algorithm uses the DPRRT* algorithm in the cooperative planning layer to replan the 4D cooperative path of all UAVs. Due to the constraints of spatial cooperation, the cooperative paths of the three UAVs do not collide, thus meeting the requirements of spatial cooperation. At the same time, combining the deviation between the expected cooperation path and the actual planned cooperation path in Table 4, it can be seen that the deviation percentage is within the allowable range, meeting the time cooperation requirements.