发表在Mathematical Biosciences and Engineering的文章:IHAOAVOA: An improved hybrid aquila optimizer and African vultures optimization algorithm for global optimization problems.https://www.x-mol.com/paperRedirect/1572654041256222720
01.引言
天鹰优化器(AO)和非洲秃鹰优化算法(AVOA)是两种新开发的元启发式算法,分别模拟自然界中天鹰座和非洲秃鹰的几种智能狩猎行为。AO具有强大的全局探索能力,但其局部开发阶段不够稳定。另一方面,AVOA具有可观的开发能力,但探索机制不足。基于两种算法的特点,本文提出了一种改进的混合AO和AVOA优化器,称为IHAOAVOA,以克服单一算法的不足,为解决全局优化问题提供更高质量的解决方案。首先,将 AO 的探索阶段和 AVOA 的开发阶段结合起来,以保留各自有价值的搜索能力。然后,一种新的复合反对学习(COBL)旨在增加种群多样性并帮助混合算法摆脱局部最优。此外,为了更有效地指导搜索过程,平衡探索和利用,引入适应度-距离平衡(FDB)选择策略来修改核心位置更新公式。通过在 23 个经典基准函数和 IEEE CEC2019 测试套件上与基本 AO、AVOA 和六种最先进的算法进行比较,对所提出的 IHAOAVOA 的性能进行了全面调查和分析。实验结果表明,与其他比较方法相比,IHAOAVOA 在大多数测试函数上都实现了优越的求解精度、收敛速度和局部最优避免。此外,通过解决五个工程设计问题,突出了 IHAOAVOA 的实用性。我们的研究结果表明,在解决实际优化任务时,所提出的技术也具有很强的竞争力和前景。
02.代码流程图
3.部分代码
%___________________________________________________________________________________________________________%
% IHAOAVOA: An improved hybrid Aquila optimizer and African vultures optimization algorithm(IHAOAVOA) source codes demo 1.0
% %
% Developed in MATLAB R2017a %
% %
% Author and programmer: Yaning Xiao,Yanling Guo, Hao Cui, Yangwei Wang, Jian Li, Yapeng Zhang %
% %
% e-Mail: xiaoyaning@nefu.edu.cn, nefugyl@hotmail.com %
% %
%___________________________________________________________________________________________________________%
% The IHAOAVOA Optimization Algorithm
function [ihaoavoa_score,ihaoavoa_pos,ihaoavoa_curve]=IHAOAVOA(N,max_iter,lb,ub,dim,fobj)
tic
% initialize Best_vulture1, Best_vulture2
ihaoavoa_pos=zeros(1,dim);
ihaoavoa_score=inf;
Best_vulture2_X=zeros(1,dim);
Best_vulture2_F=inf;
%Initialize the first random population of vultures
X=initialization(N,dim,ub,lb);
%% Controlling parameter
%/********AVOA**********/
p2=0.4;
p3=0.6;
alpha=0.8;
betha=0.2;
gamma=2.5;
%/********AO**********/
avto = 1:dim;
u = .0265;
r0 = 10;
rao = r0 +u*avto;
omega = .005;
phi0 = 3*pi/2;
phi = -omega*avto+phi0;
x = rao .* sin(phi);
y = rao .* cos(phi);
%/********LOBL**********/
k=12000; % Scale Coefficient
t=1; % Loop counter
%%Main loop
while t <= max_iter
%% Evaluate the fitness
for i=1:size(X,1)
% Calculate the fitness of the population
current_vulture_X = X(i,:);
current_vulture_F=fobj(current_vulture_X);
% Update the first best two vultures if needed
if current_vulture_F<ihaoavoa_score
ihaoavoa_score=current_vulture_F; % Update the first best bulture
ihaoavoa_pos=current_vulture_X;
end
if current_vulture_F>ihaoavoa_score && current_vulture_F<Best_vulture2_F
Best_vulture2_F=current_vulture_F; % Update the second best bulture
Best_vulture2_X=current_vulture_X;
end
end
a=unifrnd(-2,2,1,1)*((sin((pi/2)*(t/max_iter))^gamma)+cos((pi/2)*(t/max_iter))-1);
P1=(2*rand+1)*(1-(t/max_iter))+a;
%% FDB
index = fitnessDistanceBalance(X,ihaoavoa_score);
%% Update the location
for i=1:size(X,1)
current_vulture_X = X(i,:); % pick the current vulture back to the population
F=P1*(2*rand()-1);
random_vulture_X=random_select(ihaoavoa_pos,Best_vulture2_X,alpha,betha);
%% Composite opposition-based learning strategy (COBL)
if rand<0.5
opposite_X=lb+ub-rand*current_vulture_X;
else
opposite_X=(ub + lb)/2 + (ub + lb)/(2*k) - current_vulture_X/k;
end
Flag_UB=opposite_X>ub; % check if they exceed (up) the boundaries
Flag_LB=opposite_X<lb; % check if they exceed (down) the boundaries
opposite_X=(opposite_X.*(~(Flag_UB+Flag_LB)))+ub.*Flag_UB+lb.*Flag_LB;
Fnew=fobj(opposite_X);
if Fnew<fobj(current_vulture_X)
current_vulture_X=opposite_X;
end
if Fnew<ihaoavoa_score
ihaoavoa_pos=current_vulture_X;
ihaoavoa_score=Fnew;
end
%% Exploration stage:AO
if abs(F) >= 1
if rand <0.5
current_vulture_X=ihaoavoa_pos*(1-t/max_iter)+(mean(X(i,:))-ihaoavoa_pos)*rand();
else
current_vulture_X=ihaoavoa_pos.*Levy(dim)+X(index,:)+(y-x)*rand;
end
%% Exploitation stage:AVOA
elseif abs(F) < 1
current_vulture_X = exploitation(current_vulture_X, ihaoavoa_pos, Best_vulture2_X, random_vulture_X, F, p2, p3, dim, ub, lb); % Modified the position-weighted equation
end
X(i,:) = current_vulture_X; % place the current vulture back into the population
end
t=t+1;
ihaoavoa_curve(t)=ihaoavoa_score;
X = boundaryCheck(X, lb, ub);%check the boundary
end
toc
end
03.代码效果图
获取代码请关注MATLAB科研小白的个人公众号(即文章下方二维码),并回复:IHAOAVOA本公众号致力于解决找代码难,写代码怵。各位有什么急需的代码,欢迎后台留言~不定时更新科研技巧类推文,可以一起探讨科研,写作,文献,代码等诸多学术问题,我们一起进步。