| Algorithm 1. Starling-behavior-inspired flocking control algorithm for UAVs |
| /*Initialization*/ Set initial parameters of the proposed algorithm and the model of fixed-wing UAV Generate the position of UAV i randomly /*Begin*/ for i = 1 to n for j = 1 to n Select neighbors according to Equation (1) if UAV j is the neighbor of UAV i UAV i interact with UAV j according to Equation (21) according to Equation (9) end if according to Equation (12) according to Equations (10) and (11) end for to Equation (16) Execute collision prediction according to Equation (17) Calculate the control signal of evasion pattern of UAV i according to Equation (22) end if if there exist a local leader li Set parameter β = 0 UAV i follows the local leader according to Equation (21) end if end if Follow the virtual leader according to Equation (23) /*Limitation*/ Set limitations according to Equation (15) Update the position and velocity according to Equations (24) and (25) end for |