蜘蛛蜂优化算法(Spider wasp optimizer,SWO)由Mohamed Abdel-Basset等人于2023年提出,该算法模型雌性蜘蛛蜂的狩猎、筑巢和交配行为,具有搜索速度快,求解精度高的优势。
参考文献:
[1]Abdel-Basset, M., Mohamed, R., Jameel, M. et al. Spider wasp optimizer: a novel meta-heuristic optimization algorithm. Artif Intell Rev (2023). Spider wasp optimizer: a novel meta-heuristic optimization algorithm | Artificial Intelligence Review
无人机集群路径规划:蜘蛛蜂优化算法(Spider wasp optimizer,SWO)-CSDN博客
clc clear close all tic %% 地图 global G S E G=[0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0; 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0; 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0; 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0; 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0; 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0; 0 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0; 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0; 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 0; 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0; 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0; 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0; 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0; 1 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0; 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0;]; for i=1:20/2 for j=1:20 m=G(i,j); n=G(21-i,j); G(i,j)=n; G(21-i,j)=m; end end %% S = [1 1]; %起点 E = [20 20]; %终点 [ub,dimensions] = size(G); dim = dimensions - 2; %% 参数设置 Max_iter= 200; % 最大迭代次数 SearchAgents_no = 50; % 种群数量 X_min = 1; lb=1; fobj=@(x)fitness(x); [Best_score,Best_NC,Convergence_curve]=SWO(SearchAgents_no,Max_iter,lb,ub,dim,fobj); toc %% 结果分析 global_best = round(Best_NC); figure(1) plot(Convergence_curve,'r-','linewidth',2.5) xlabel('Iteration'); ylabel('Fitness'); legend('SWO')