java怎么实现跳转到指定页面
367
2022-09-04
【单目标优化求解】基于matlab增强型黑猩猩优化器算法求解单目标优化问题【含Matlab源码 2013期】
一、黑猩猩优化算法(ChOA)简介
1 ChOA数学描述
黑猩猩优化算法(ChOA) 是M.Khi she等人于2020年根据黑猩猩群体狩猎行为提出的一种新型元启发式优化算法。ChOA通过模拟攻击黑猩猩、驱赶黑猩猩、拦截黑猩猩和追逐黑猩猩4类黑猩猩协同狩猎行为来达到求解问题的目的。与其他算法相比, ChOA具有收敛速度快、寻优精度高等特点。
(1)驱赶和追逐猎物。
在黑猩猩狩猎过程中,通常根据黑猩猩个体智力和性动机来分配狩猎职责。任何黑猩猩均可随机改变其在猎物周围空间中的位置,数学描述为
d=|cx prey(t) -mx chimp(t) |(1)
x chimp(t+1) =X prey(t) -ad(2)
式中:d为黑猩猩与猎物间距; t为当前迭代次数; X prey(t) 为猎物位置向量; X chimp(t) 为黑猩猩位置向量; a、m、c为系数向量, a=2fr 1-f, c=2r 2, m=Chaotic_value(基于混沌映射的混沌向量) , f为迭代过程中从2.0非线性降至0, r 1、r 2为[0, 1] 范围内的随机向量。
(2)攻击方式。
黑猩猩能够探查猎物位置(通过驱赶、拦截和追逐),然后包围猎物。狩猎过程通常由攻击黑猩猩进行,驱赶黑猩猩、拦截黑猩猩和追逐黑猩猩参与狩猎过程。4类黑猩猩通过下式更新其位置,其他黑猩猩根据最佳黑猩猩位置更新其位置,猎物位置由最佳黑猩猩个体位置估计。数学描述为
式中:dAttacker、dBarrier、dChaser、dDriver分别为当前攻击黑猩猩、拦截黑猩猩、追逐黑猩猩、驱赶黑猩猩与猎物的间距;xAttacker、xBarrier、xChaser、xDriver分别为攻击黑猩猩、拦截黑猩猩、追逐黑猩猩、驱赶黑猩猩相对于猎物的位置向量;a1~a4、m1~m4、c1~c4分别为攻击黑猩猩、拦截黑猩猩、追逐黑猩猩、驱赶黑猩猩系数向量;x1、x2、x3、x4分别为攻击黑猩猩、拦截黑猩猩、追逐黑猩猩和驱赶黑猩猩位置更新向量;x为其他黑猩猩位置向量。
(3)攻击和寻找猎物。
在狩猎最后阶段,一方面黑猩猩根据攻击者、驱赶者、拦截者和追逐者位置更新位置,并攻击猎物;另一方面黑猩猩通过分散寻找猎物显示探查过程,即ChOA全局搜索。
(4)社会动机。
社会动机(修饰)会导致黑猩猩放弃其狩猎职责,这一行为有助于ChOA在求解高维问题时克服陷入局部最优和收敛速度慢等缺点。在优化过程中,通过50%的概率选择黑猩猩正常位置更新或通过混沌模型进行位置更新。数学模型表示为
式中:μ为[0,1]范围内的随机数。
二、部分源代码
close allclearclcAlgorithm_Name = 'I-ChoA';N = 30; % Number of search agentsSearchAgents_no =N;Function_name='F2'; % 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);[ABest_scoreChimp1,ABest_posChimp1,IChoA_curve]=IChoA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);figure('Position',[500 500 660 290])%Draw search spacesubplot(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 spacesubplot(1,2,2);semilogy(IChoA_curve,'Color','r')title('Objective space')xlabel('Iteration');ylabel('Best score obtained so far');axis tightgrid onbox onlegend('I-ChoA')function [Attacker_score,Attacker_pos,Convergence_curve]=IChoA(N,Max_iter,lb,ub,dim,fobj)% initialize Attacker, Barrier, Chaser, and DriverAttacker_pos=zeros(1,dim);Attacker_score=inf; %change this to -inf for maximization problemsBarrier_pos=zeros(1,dim);Barrier_score=inf; %change this to -inf for maximization problemsChaser_pos=zeros(1,dim);Chaser_score=inf; %change this to -inf for maximization problemsDriver_pos=zeros(1,dim);Driver_score=inf; %change this to -inf for maximization problems%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%lu = [lb .* ones(1, dim); ub .* ones(1, dim)]; %% =========%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Initialize the positions of search agentsPositions=initialization(N,dim,ub,lb);%============================================================Positions = boundConstraint (Positions, Positions, lu); %% =====% Calculate objective function for each champfor i=1:size(Positions,1) Fit(i) = fobj(Positions(i,:));end% Personal best fitness and position obtained by each champpBestScore = Fit;pBest = Positions;neighbor = zeros(N,N);%%=======================================================================Convergence_curve=zeros(1,Max_iter);l=0;% Loop counter%%% Main loopwhile l
三、运行结果
四、matlab版本及参考文献
1 matlab版本 2014a
2 参考文献 [1] 包子阳,余继周,杨杉.智能优化算法及其MATLAB实例(第2版)[M].电子工业出版社,2016. [2]张岩,吴水根.MATLAB优化算法源代码[M].清华大学出版社,2017. [3]程国森,崔东文.黑猩猩优化算法-极限学习机模型在富水性分级判定中的应用[J].人民黄河. 2021,43(07)
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~