Skip to main content
. 2021 Feb 9;21(4):1224. doi: 10.3390/s21041224
Algorithm 2 CASSA for 3d UAV route planning
/*Initialization*/
1. Set the parameters of CASSA same as Algorithm 1;
2. Set the start point (xS,yS), target point (xT,yT), the boundaries of the map space, and
    the number of control points n;
3. Set the position(xthreat,ythreat) and the range of threats;
/*Iterative search*/
4. while (t<Tmax)
5. Each sparrow represents a route; sort the population of sparrows from best to worst by
    order of cost function Equation (10) for each sparrow
6. G=rand(1);
7. for i=1:Fd
8.   Update the finder’s position using Equation (7);
9. end for
10. for i=(Fd+1):n
11.   Update the entrant’s position using Equation (3);
12. end for
13. for i=1:Sd
14.   Update the threatened sparrow’s position using Equation (4);
15. end for
16. Evaluate the cost for each route by Equation (13), then select the top S elite sparrows with the
    best fitness value and implement adaptive mutation for them by Equation (9);
17. Get the current new route;
18. If the new route is better than before, update it;
19. Generate the B-Spline curve with the n waypoints.
20. t=t+1;
21. end while
22. Output the best route and its cost value.
23. Post-process results and visualization