## 4 Cluster Path Planning Method That Resembles a Starling Flock
### Cluster Path Planning Method That Resembles a Starling Flock  
According to the starling cluster cooperative method described in Section 2, the UAV cluster can move in space while maintaining a specific formation. However, the algorithm focuses on maintaining the cluster flight state and ensuring the safe flight of each UAV. To adapt the current UAV input commands based on prediction results with locally feasible solutions, dynamic prediction must first anticipate future behavior based on the current situation and gathered environmental information. This enables effective flight in challenging terrain and reduces the likelihood of getting stuck. The dynamic prediction process is divided into two phases: the first adjusts the system's position and state within the cluster; the second uses the RRT algorithm to solve the path for the immediate environment based on these adjustments. The final step uses a value function to evaluate the path solution and determine a locally optimal path based on known cluster and environmental data. For each exploration of a new node, the starling clustering algorithm's learning behavior generates a moving path and state update that is added as a set of branches to the value function estimation and final path solution selection. This increases the efficiency of obtaining feasible solutions. The value estimation function \(J\) is defined as follows:  
\[J=\sum_{k=1}^{k_{p}-1}L_{Dubins}(x_{i}^{k},x_{i}^{k+1})+K_{a}L_{Dubins}(x_{i}^{ k_{p}},x_{aim}). \tag{27}\]  
where \(x_{i}^{k}\) denotes the \(k\)th prediction state of the \(i\)th UAV, \(k_{p}\) denotes the number of prediction iterations, \(L_{Dubins}(x^{1},x^{2})\) denotes the Dubins aircraft path distance between two nodes \(x^{1},x^{2}\), and \(K_{a}\) is the target distance weight function. Increasing \(K_{a}\) can speed up the speed of getting feasible solutions, but it also tends to lead to the space of no solutions. The final outcome for the entire prediction process is specified as:  
\[\mathrm{Y}_{p}=\mathrm{Y}_{b}(x^{1}{}_{i},x^{2}{}_{i},\dots,x^{k_{k}}{}_{i}{}_ {r})+\mathrm{Y}_{rtrt}(x^{s+1}{}_{i},x^{s+2}{}_{i},\dots,x^{k_{p}}{}_{i}{}_{r}) \tag{28}\]  
where \(\mathrm{Y}_{b}\) denotes cluster-location-adjusted path prediction and \(\mathrm{Y}_{rtt}\) denotes path planning prediction for 3D fast search trees. \[\mathrm{Y}_{b}=update\_starling(X^{k}{}_{i},k_{s}) \tag{29}\]  
Equation (29) denotes position-adjusted path generation, \(X^{k}{}_{i}\) is the set of all UAV state quantities within the sensing range of \(agent_{i}\), \(k_{s}\) is the number of iterations required to enter the free exploration flight, and \(starling()\) the state update equation of the starling clustering algorithm. \[\mathrm{Y}_{rtt}=K_{learn}(starling(X^{k}{}_{i},(k_{p}-k_{s})))+K_{r}(RRTpath (X^{k}{}_{i},(k_{p}-k_{s}))) \tag{30}\]  
Figure 13: (a) High-altitude climbing Dobins aircraft path. (b) Top view of the path. Equation (30) denotes the path solution generated by location path planning, \(RRTPath()\) is a three-dimensional spatial fast random search tree algorithm, \(K_{learn},K_{r}\) is the corresponding weight function, \(K_{r}\) the larger the predicted solution space per iteration is larger. \[\mathrm{Y}_{i}=\mathrm{Y}_{p}\qquad\quad L_{Dubins}(x^{1}{}_{i},x^{2}{}_{i}, \dots,x^{k}{}_{i})<v_{i} \tag{31}\]  
\(\mathrm{Y}_{i}\) is the execution path of this iteration. The longer the time in the non-secure environment, the more the \(K_{learn}\) weight parameter varies with time:  
\[ \begin{cases}K_{learn}=K_{learn}-t(K_{learn}/t_{e})\qquad t\leqslant t_{e}\\ K_{learn}=0\qquad else\end{cases}  \tag{32}\]  
In summary, the wider the solution space is for each iteration, the longer the UAV cluster is imprisoned in a complex environment. As shown in Figure 14, the starling clustering algorithm's structure is maintained, with a higher priority given to maintaining cluster positions in flight dynamics prediction than to path planning.