## 2 Starling-Mimicking Flock Algorithm
### A Model of Starling Cluster Behavior
Return behavior: After conducting specific experimental tests, it was found that it is less efficient to return to the cluster by gathering behavior when multiple agents are far away from more than the cluster because of exploring the environment, so a returning behavior is defined, \(C_{a}\) denotes the center of the cluster, \(d_{ia}\) denotes the distance from the agent to the center of the cluster, and when \(d_{ia}>R_{a}\), it means the agent has left the cluster. Performing regression behavior, \(R_{a}\) denotes the cluster activity range, which is a dynamic variable. When the cluster is in a safe flight space \(R_{a}\) is at a smaller value, constraining the cluster to fly as a compact whole, and when the cluster is in a complex environment or disturbed by invasion \(R_{a}\) is at a larger value, enabling the cluster to have a relatively large margin of space to escape and evade, shown in the Figure 3. When none of the agents in the whole cluster is disturbed by the external environment and it lasts for a period of time, the environment at that time is defined as a safe space. If the disturbance information is received by one agent body, then the information will be quickly propagated to the whole through individual local information interactions, canceling the definition of safe space. The acceleration \(a_{i}\) of the regression behavior is calculated as follows: \[a_{i}=K_{dr}(d_{ia}-R_{a})+(K_{vr}v_{neighbor_{i}}-v_{i})\] (6) where \(K_{dr}\) and \(K_{vr}\) are the displacement deviation weight parameter and velocity proportional adjustment parameter, respectively. When traversing certain terrains, the cluster may split into two clusters. In such cases, it is important for the two clusters to quickly reconstitute as a whole. This can be achieved by adjusting the \(K_{dr}\) and \(K_{vr}\) parameters. Increasing the value of \(K_{dr}\) results in a greater acceleration of cluster regression. Increasing the value of \(K_{vr}\) increases the desired speed of cluster regression, allowing for faster cluster regression even in challenging terrains such as narrow mountains. Figure 2: (a) Gathering behavior. (b) Dispersal behavior. 4. Avoidance escape behavior: The avoidance escape behavior is the highest priority behavior, which is triggered when an individual agent is disturbed by external factors. The individual agent that perceives the disturbance will randomly choose a direction to avoid the disturbing individual and start to escape, continue accelerating to the maximum speed \(v_{max}\) during the escape process, and stop the behavior when the disturbing individual is outside the perception range for a period of time, and at the same time, the agent will synchronize the escape information to the surrounding neighbors. The agent that receives the synchronized escape information but does not perceive the interfering individual will imitate and learn from the agent at the outermost part of the current perception range \(R_{p}\) and will no longer stay in close formation, but will change into a spread formation away from the center of its immediate neighbors \(C\). The escape acceleration is calculated as: \[a_{i}=\frac{K_{a}}{\|p_{d}-p_{i}\|}\] (7) where \(K_{a}\) denotes the escape acceleration parameter and \(p_{d}\) denotes the position of the interfering individual. The value of \(K_{a}\) determines the amplitude of the cluster's evasive escape behavior. Setting a larger value, based on the acceleration capability of the UAVs, allows the cluster to reach its maximum escape speed faster and avoid danger in a timely manner. 5. Free flight exploration behavior: Free flight exploration behavior is the lowest priority intelligent body behavior. When the agent body keeps in the appropriate position interval \([R_{minit},R_{maxl}]\) in the near-neighbor group, the starling will make a comparative judgment of its own state and the surrounding near-neighbor individuals, and adjust its flight state.