优化求解基于混沌反向学习改进灰狼算法matlab源码
Posted MatlabQQ1575304183
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了优化求解基于混沌反向学习改进灰狼算法matlab源码相关的知识,希望对你有一定的参考价值。
灰狼优化算法(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)]);
完整代码或者代写添加QQ1575304183
以上是关于优化求解基于混沌反向学习改进灰狼算法matlab源码的主要内容,如果未能解决你的问题,请参考以下文章