欢迎光临散文网 会员登陆 & 注册

【灰狼算法】基于混合灰狼算法求解单目标优化问题附matlab代码

2022-05-04 01:18 作者:Matlab工程师  | 我要投稿

1 简介

2 部分代码

%  Adaptive mixed Grey Wold Optimizer                                     %%                                                                         %% Main paper:% Martin, Benoit, Julien Marot, and Salah Bourennane.% "Mixed grey wolf optimizer% for the joint denoising and unmixing of multispectral images."% Applied Soft Computing 74 (2019): 385-410.%--------------------------------------------------------------------%% 'amixedGWO'% 'MixedGWO'% Main paper:% Martin, Benoit, Julien Marot, and Salah Bourennane.% "Mixed grey wolf optimizer% for the joint denoising and unmixing of multispectral images."% Applied Soft Computing 74 (2019): 385-410.%%%%clear allclose allclcNbRuns=1;% 1000%%% All available optimization methods:%Optimization_Methods={'amixedGWO','MixedGWO','GWO','GWOCS','GAO','PSO','WOA','ABC','TSA','SA','PSOGSA','MVO','CGSA'};%%Optimization_Methods={'CGSA'};%,'amixedGWO','PSO','GWO','TSA','CGSA'%Optimization_Methods={'amixedGWO','PSO','GWO','TSA','CGSA'};%,'amixedGWO','PSO','GWO','TSA','CGSA'%Optimization_Methods={'WOA','GWO','CGSA'};%,'amixedGWO','PSO','GWO','TSA','CGSA'%Optimization_Methods={'amixedGWO','PSO'};% 'GCGWO',Optimization_Methods={'PSO','GWO','amixedGWO'};%,'MVO' % 'MixedGWO','PSOGSA', 'WOA' ,'amixedGWO','ABC'%Optimization_Methods={'amixedGWO'};%%% ,'MVO' % 'MixedGWO','PSOGSA', 'WOA' ,'amixedGWO','ABC'%Optimization_Methods={'GWO'};%,'MVO' % 'MixedGWO','PSOGSA', 'WOA' ,'amixedGWO','ABC'%Optimization_Methods={'amixedGWO','GWO'};%,'MVO' % 'MixedGWO','PSOGSA', 'WOA' ,'amixedGWO','ABC'%%% Creation of the parameters which aer valid for all methodsSearchAgents_no=100;%30 % Number of search agents % 40%%% Too few: mixed GWO does not have time to explore.%%% if the dimension of the problem increases, you have to increase the%%% number of search agents.%%% in dimension 10, choose 200.%%% in dimension 5, choose 50.Max_iteration=50; %20 Option_Intense_Graphics=1;%%% 1: Intense graphics, we display the agents at each iteration.%%% 0: No display of the agents.%%% F17 to F23: fixed dimension%%% It is not recommended to plot them in a 2D space because it does not%%% represent the actual values of the function, which do not exist in 2D.Optimizer_Agents_Plot{1}=Option_Intense_Graphics;Nb_Methods=length(Optimization_Methods);Option_Log=1;[Best_score_All_Methods_All_Runs,GMean_Convergence_Curve_All_Methods,AMean_Convergence_Curve_All_Methods]=...    Initialize_Statistic_Results(NbRuns,Nb_Methods,Max_iteration);% ind=4;% Function_name=['F',num2str(ind)]; % Name of the test function that can be from F1 to F23%Function_name='F2';%F1  % NDparabola % Extreme_Slopes % Halong Mountains2D % ProcessImage%Function_name='F10';%F1  % NDparabola % Extreme_Slopes % Halong Mountains2D % ProcessImage%Function_name='ExtremeSlopes';%Function_name='Run_Whole_Classification_in_Optimization';%Classification_Surrogate%Function_name='Mountains2D';%Mountains2D%Function_name='Run_Simple_Recognition_in_Optimization';%%Function_name='Classification_Surrogate';%Function_name='F10';%%disp(['Objective function: ',Function_name])[lb,ub,dim,fobj]=Get_Functions_details(Function_name);%%% Creation of the parameters which are specifically dedicated to adaptive%%% mixed GWO. These parameters concern the search spaces and should be%%% adapted depending on the objective functionCreate_Parameters_amixed_GWOfor ind_Run=1:NbRuns       %Setup_From_Interface%%% Should be commented if we do not use the interface    Best_score_All_Methods=zeros(1,Nb_Methods);    Best_pos_All_Methods=zeros(dim,Nb_Methods);    Convergence_Curve_All_Methods=zeros(Max_iteration,Nb_Methods);    Computational_Time=zeros(1,Nb_Methods);    for Index_Method=1:Nb_Methods        Optimizer=str2func(Optimization_Methods{1,Index_Method});        disp('%%%%%%%%%%%%%%%%%%%%%%%%')        disp('Optimization algorithm:')        disp(Optimizer)        Optimizer_Agents_Plot{2}=Optimizer;        %             disp('We are running: ')        %             disp(Optimizer)        t = clock;        [Best_score,Best_pos,Convergence_Curve]=feval(Optimizer,SearchAgents_no,Max_iteration,lb,ub,dim,fobj,Optimizer_Agents_Plot);        %    pause        Computational_Time(Index_Method)=etime(clock, t);        Best_score_All_Methods(1,Index_Method)=Best_score;        Best_pos_All_Methods(:,Index_Method)=Best_pos(:);        Convergence_Curve_All_Methods(:,Index_Method)=Convergence_Curve;        GMean_Convergence_Curve_All_Methods(:,Index_Method)=GMean_Convergence_Curve_All_Methods(:,Index_Method).*Convergence_Curve_All_Methods(:,Index_Method);        AMean_Convergence_Curve_All_Methods(:,Index_Method)=AMean_Convergence_Curve_All_Methods(:,Index_Method)+Convergence_Curve_All_Methods(:,Index_Method);        Best_score_All_Methods_All_Runs(ind_Run,Index_Method)=Best_score_All_Methods(1,Index_Method);          end      % Option_Log=0;    Display_Graphic_Results(Function_name,Optimization_Methods,Convergence_Curve_All_Methods,Option_Log,ind_Run)    Display_Numerical_Results(Optimization_Methods,Best_pos_All_Methods,Best_score_All_Methods,Computational_Time)    Save_Results_in_txt_Files(Optimization_Methods,Best_pos_All_Methods,Best_score_All_Methods,Computational_Time,Convergence_Curve_All_Methods)    endDisplay_Statistic_Results

3 仿真结果


4 参考文献

[1] Martin B ,  Marot J ,  Bourennane S . Mixed grey wolf optimizer for the joint denoising and unmixing of multispectral images[J]. Applied Soft Computing, 2018, 74.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。



【灰狼算法】基于混合灰狼算法求解单目标优化问题附matlab代码的评论 (共 条)

分享到微博请遵守国家法律