非洲秃鹫优化算法(AVOA)发表在中科院一区Computers & Industrial Engineering期刊上的论文“African vultures optimization algorithm: A new nature-inspired metaheuristic algorithm for global optimization problems"
01.引言
元启发式算法在求解优化问题中起着至关重要的作用。大多数这样的算法都是受到集体智慧和自然界生物觅食的启发。本文以非洲秃鹫的生活方式为灵感,提出了一种新的元启发式方法。该算法被命名为非洲秃鹫优化算法(AVOA),它模拟了非洲秃鹫的觅食和导航行为。为了评估AVOA的性能,首先在36个标准基准函数上进行了测试。然后进行了比较研究,证明了所提出的算法与几种现有算法相比的优越性。为了展示AVOA算法的适用性及其黑箱特性,本文利用AVOA算法对11个工程设计问题求最优解。
0.2.代码流程图
03.部分代码
function [Best_vulture1_F,Best_vulture1_X,convergence_curve]=AVOA(pop_size,max_iter,lower_bound,upper_bound,variables_no,fobj)
% initialize Best_vulture1, Best_vulture2
Best_vulture1_X=zeros(1,variables_no);
Best_vulture1_F=inf;
Best_vulture2_X=zeros(1,variables_no);
Best_vulture2_F=inf;
%Initialize the first random population of vultures
X=initialization(pop_size,variables_no,upper_bound,lower_bound);
%% Controlling parameter
p1=0.6;
p2=0.4;
p3=0.6;
alpha=0.8;
betha=0.2;
gamma=2.5;
%%Main loop
current_iter=0; % Loop counter
while current_iter < max_iter
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<Best_vulture1_F
Best_vulture1_F=current_vulture_F; % Update the first best bulture
Best_vulture1_X=current_vulture_X;
end
if current_vulture_F>Best_vulture1_F && 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)*(current_iter/max_iter))^gamma)+cos((pi/2)*(current_iter/max_iter))-1);
P1=(2*rand+1)*(1-(current_iter/max_iter))+a;
% 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(Best_vulture1_X,Best_vulture2_X,alpha,betha);
if abs(F) >= 1 % Exploration:
current_vulture_X = exploration(current_vulture_X, random_vulture_X, F, p1, upper_bound, lower_bound);
elseif abs(F) < 1 % Exploitation:
current_vulture_X = exploitation(current_vulture_X, Best_vulture1_X, Best_vulture2_X, random_vulture_X, F, p2, p3, variables_no, upper_bound, lower_bound);
end
X(i,:) = current_vulture_X; % place the current vulture back into the population
end
current_iter=current_iter+1;
convergence_curve(current_iter)=Best_vulture1_F;
X = boundaryCheck(X, lower_bound, upper_bound);
fprintf("In Iteration %d, best estimation of the global optimum is %4.4f \n ", current_iter,Best_vulture1_F );
end
end
04.代码效果图
获取代码请关注MATLAB科研小白的个人公众号(即文章下方二维码),并回复:智能优化算法本公众号致力于解决找代码难,写代码怵。各位有什么急需的代码,欢迎后台留言~不定时更新科研技巧类推文,可以一起探讨科研,写作,文献,代码等诸多学术问题,我们一起进步。