| Algorithm 2 CASSA for 3d UAV route planning |
|
/*Initialization*/ 1. Set the parameters of CASSA same as Algorithm 1; 2. Set the start point , target point , the boundaries of the map space, and the number of control points ; 3. Set the position and the range of threats; /*Iterative search*/ 4. while () 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. ; 7. for 8. Update the finder’s position using Equation (7); 9. end for 10. for 11. Update the entrant’s position using Equation (3); 12. end for 13. for 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 waypoints. 20. ; 21. end while 22. Output the best route and its cost value. 23. Post-process results and visualization |