1 内容介绍
圆圈搜索算法(Circle Search Algorithm,CSA)由Mohammed H. Qais等人于2022年提出,该算法由圆上正切关系启发所得,思路新颖,简单高效。
2 仿真代码
%___________________________________________________________________%
% This is the main program that call all compared algorithms
clear all;
clc; close all;
SearchAgents_no=30; % Number of search agents
Function_name='F1'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)
Max_iteration=500; % Maximum numbef of iterations
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
Positions=zeros(SearchAgents_no,dim);
%initialize the search agents for all algorithms
for i=1:SearchAgents_no
Positions(i,:)=lb+rand*(ub-lb);
end
[X_c1,X_t1,curve1]=CSA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c2,X_t2,curve2]=SCA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c3,X_t3,curve3]=SSA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c4,X_t4,curve4]=HHO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c5,X_t5,curve5]=WOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c6,X_t6,curve6]=PSO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c7,X_t7,curve7]=TSO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c8,X_t8,curve8]=GWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
[X_c9,X_t9,curve9]=CGO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Positions);
semilogy(curve1,'Color','r','LineWidth',2)%CSA
hold on
semilogy(curve8,'Color','b','LineWidth',2)%GWO
semilogy(curve2,'Color','m','LineWidth',2)%SCA
semilogy(curve3,'Color','g','LineWidth',2)%SSA
semilogy(curve4,'Color','y','LineWidth',2)%HHO
semilogy(curve5,'Color','k','LineWidth',2)%WOA
semilogy(curve6,'Color',[0.9290 0.6940 0.1250],'LineWidth',2)%PSO
semilogy(curve7,'Color',[0.4940 0.1840 0.5560],'LineWidth',2)%TSO
semilogy(curve9,'Color','c','LineWidth',2)%CGO
title(Function_name)
xlabel('Iteration','fontsize',12,'FontWeight','bold','FontName','Arial Narrow');
ylabel('Best Fitness','fontsize',12,'FontWeight','bold','FontName','Arial Narrow');
axis tight
grid on
box on
legend('CSA','GWO','SCA','SSA','HHO','WOA','PSO','TSO','CGO','fontsize',12,'FontWeight','bold','FontName','Arial Narrow')
disp(["CSA"," SCA"," SSA"," HHO"," WOA"," PSO"," TSO"," GWO"," CGO"])
output=[X_c1 X_c2 X_c3 X_c4 X_c5 X_c6 X_c7 X_c8 X_c9]
3 运行结果
编辑
4 参考文献
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。