金豺狼优化(Golden jackal optimization,GJO)是期刊“Expert Systems with Applications”(中科院一区IF 8.3)的2022年智能优化算法
01.引言
金豺狼优化(Golden jackal optimization,GJO)旨在为解决实际工程问题提供一种替代的优化方法。GJO的灵感来自金豺(Canis aureus)的合作狩猎行为。算法的三个基本步骤是猎物搜索、包围和猛扑,并对它们进行了数学建模和应用。通过比较不同的元启发式算法在基准函数上的性能,评估了所提算法的性能。本文对该算法进行了进一步的测试,以解决七个不同的工程设计问题,并介绍了该算法在电气工程领域的实际应用。经典工程设计问题和实际实现的结果验证了该算法适用于具有未知搜索空间的挑战性问题。
02.优化算法的流程
03.论文中算法对比图
04.部分代码
function [Male_Jackal_score,Male_Jackal_pos,Convergence_curve]=GJO(SearchAgents_no,Max_iter,lb,ub,dim,fobj)
%% initialize Golden jackal pair
Male_Jackal_pos=zeros(1,dim);
Male_Jackal_score=inf;
Female_Jackal_pos=zeros(1,dim);
Female_Jackal_score=inf;
%% Initialize the positions of search agents
Positions=initialization(SearchAgents_no,dim,ub,lb);
Convergence_curve=zeros(1,Max_iter);
l=0;% Loop counter
% Main loop
while l<Max_iter
for i=1:size(Positions,1)
% boundary checking
Flag4ub=Positions(i,:)>ub;
Flag4lb=Positions(i,:)<lb;
Positions(i,:)=(Positions(i,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb;
% Calculate objective function for each search agent
fitness=fobj(Positions(i,:));
% Update Male Jackal
if fitness<Male_Jackal_score
Male_Jackal_score=fitness;
Male_Jackal_pos=Positions(i,:);
end
if fitness>Male_Jackal_score && fitness<Female_Jackal_score
Female_Jackal_score=fitness;
Female_Jackal_pos=Positions(i,:);
end
end
E1=1.5*(1-(l/Max_iter));
RL=0.05*levy(SearchAgents_no,dim,1.5);
for i=1:size(Positions,1)
for j=1:size(Positions,2)
r1=rand(); % r1 is a random number in [0,1]
E0=2*r1-1;
E=E1*E0; % Evading energy
if abs(E)<1
%% EXPLOITATION
D_male_jackal=abs((RL(i,j)*Male_Jackal_pos(j)-Positions(i,j)));
Male_Positions(i,j)=Male_Jackal_pos(j)-E*D_male_jackal;
D_female_jackal=abs((RL(i,j)*Female_Jackal_pos(j)-Positions(i,j)));
Female_Positions(i,j)=Female_Jackal_pos(j)-E*D_female_jackal;
else
%% EXPLORATION
D_male_jackal=abs( (Male_Jackal_pos(j)- RL(i,j)*Positions(i,j)));
Male_Positions(i,j)=Male_Jackal_pos(j)-E*D_male_jackal;
D_female_jackal=abs( (Female_Jackal_pos(j)- RL(i,j)*Positions(i,j)));
Female_Positions(i,j)=Female_Jackal_pos(j)-E*D_female_jackal;
end
Positions(i,j)=(Male_Positions(i,j)+Female_Positions(i,j))/2;
end
end
l=l+1;
Convergence_curve(l)=Male_Jackal_score;
end
end
function [z] = levy(n,m,beta)
num = gamma(1+beta)*sin(pi*beta/2); % used for Numerator
den = gamma((1+beta)/2)*beta*2^((beta-1)/2); % used for Denominator
sigma_u = (num/den)^(1/beta);% Standard deviation
u = random('Normal',0,sigma_u,n,m);
v = random('Normal',0,1,n,m);
z =u./(abs(v).^(1/beta));
end
04.本代码效果图
获取代码请关注MATLAB科研小白的个人公众号(即文章下方二维码),并回复智能优化算法本公众号致力于解决找代码难,写代码怵。各位有什么急需的代码,欢迎后台留言~不定时更新科研技巧类推文,可以一起探讨科研,写作,文献,代码等诸多学术问题,我们一起进步。