灰狼优化算法(Grey Wolf Optimization,GWO)是新型启元优化算法,相比于其他群体智能优化算法,该算法同样存在收敛速度较慢、不稳定、易陷入局部最优等问题。针对上述问题,根据GWO算法的结构特点,提出了一种自适应调整策略的混沌灰狼优化算法(Chaotic Local Search GWO),利用自适应调整策略来提高GWO算法的收敛速度,通过混沌局部搜索策略增加种群的多样性,使搜索过程避免陷入局部最优。最后利用6个测试函数对算法进行仿真验证,并结合其他4种算法进行了横向比较。实验结果证明,所提出的改进算法在收敛速度、精度以及稳定性方面具有明显的优势。

clear all 
clc
 
SearchAgents_no=30; % Number of search agents
Max_iteration=500; % Maximum numbef of iterations
Function_name='F12'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)
%for func_num=18:23;
  % initial_flag=0;
   %Function_name=strcat('F',num2str(func_num));
 % time=cputime;
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
[Best_score,Best_pos,GWO_cg_curve]=GWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
[Best_score,Best_pos,IGWO_cg_curve]=IGWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
PSO_cg_curve=PSO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); % run PSO to compare to results
[Best_score,Best_pos,CGWO_cg_curve]=CGWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
[Best_score,Best_pos,FGWO_cg_curve]=FGWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
[Best_score,Best_pos,SCA_cg_curve]=SCA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
figure('Position',[500 500 660 290])
%Draw search space
subplot(1,2,1);
func_plot(Function_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([Function_name,'( x_1 , x_2 )'])
 
%Draw objective space
subplot(1,2,2);
semilogy(GWO_cg_curve,'Color','r')
hold on
semilogy(PSO_cg_curve,'Color','b')
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
hold on
semilogy(IGWO_cg_curve,'Color','g')
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
hold on
semilogy(CGWO_cg_curve,'Color','c')
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
hold on
semilogy(FGWO_cg_curve,'Color','m')
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
hold on
semilogy(SCA_cg_curve,'Color','k')
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
CGWO_ave=mean2(CGWO_cg_curve);
CGWO_std=std2(CGWO_cg_curve);
GWO_ave=mean2(GWO_cg_curve);
GWO_std=std2(GWO_cg_curve);
FGWO_ave=mean2(FGWO_cg_curve);
FGWO_std=std2(FGWO_cg_curve);
IGWO_ave=mean2(IGWO_cg_curve);
IGWO_std=std2(IGWO_cg_curve);
PSO_ave=mean2(PSO_cg_curve);
PSO_std=std2(PSO_cg_curve);
SCA_ave=mean2(SCA_cg_curve);
SCA_std=std2(SCA_cg_curve);
axis tight
grid on
box on
legend('GWO','PSO','IGWO','CGWO','FGWO','SCA')
display(['The best solution obtained by CGWO is : ', num2str(Best_pos)]);
display(['The best optimal value of the objective funciton found by CGWO is : ', num2str(Best_score)]);
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.

【优化求解】基于混沌反向学习改进灰狼算法matlab源码_灰狼优化算法