💥💥💥💞💞💞欢迎来到本博客❤️❤️❤️💥💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
目录
💥1 概述
📚2 运行结果
🎉3 参考文献
🌈4 Matlab代码实现
💥1 概述
本工作提出了一种新的多目标算法,其灵感来自自然界中蚱蜢群的导航。首先使用数学模型来模拟游泳中个体的相互作用,包括吸引力、排斥力和舒适区。然后提出了一种机制,使用该模型在单目标搜索空间中近似全局最优值。然后,将存档和目标选择技术集成到算法中,以估计多目标问题的帕累托最优前沿。为了对所提算法的性能进行基准测试,利用了一组不同的标准多目标测试问题。将结果与进化多目标优化文献中最受好评和最新的算法进行了比较,使用三个性能指标定量和图形定性。结果表明,所提算法在得到的帕累托最优解的精度及其分布方面能够提供极具竞争力的结果。
📚2 运行结果
主函数代码:
clc;
clear;
close all;% Change these details with respect to your problem%%%%%%%%%%%%%%
ObjectiveFunction=@ZDT1;
dim=5;
lb=0;
ub=1;
obj_no=2;if size(ub,2)==1
ub=ones(1,dim)*ub;
lb=ones(1,dim)*lb;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
flag=0;
if (rem(dim,2)~=0)
dim = dim+1;
ub = [ub, 1];
lb = [lb, 0];
flag=1;
end max_iter=100;
N=200;
ArchiveMaxSize=100;Archive_X=zeros(100,dim);
Archive_F=ones(100,obj_no)*inf;Archive_member_no=0;
%Initialize the positions of artificial whales
GrassHopperPositions=initialization(N,dim,ub,lb);TargetPosition=zeros(dim,1);
TargetFitness=inf*ones(1,obj_no);cMax=1;
cMin=0.00004;
%calculate the fitness of initial grasshoppersfor iter=1:max_iter
for i=1:N
Flag4ub=GrassHopperPositions(:,i)>ub';
Flag4lb=GrassHopperPositions(:,i)<lb';
GrassHopperPositions(:,i)=(GrassHopperPositions(:,i).*(~(Flag4ub+Flag4lb)))+ub'.*Flag4ub+lb'.*Flag4lb;
GrassHopperFitness(i,:)=ObjectiveFunction(GrassHopperPositions(:,i)');
if dominates(GrassHopperFitness(i,:),TargetFitness)
TargetFitness=GrassHopperFitness(i,:);
TargetPosition=GrassHopperPositions(:,i);
end
end
[Archive_X, Archive_F, Archive_member_no]=UpdateArchive(Archive_X, Archive_F, GrassHopperPositions, GrassHopperFitness, Archive_member_no);
if Archive_member_no>ArchiveMaxSize
Archive_mem_ranks=RankingProcess(Archive_F, ArchiveMaxSize, obj_no);
[Archive_X, Archive_F, Archive_mem_ranks, Archive_member_no]=HandleFullArchive(Archive_X, Archive_F, Archive_member_no, Archive_mem_ranks, ArchiveMaxSize);
else
Archive_mem_ranks=RankingProcess(Archive_F, ArchiveMaxSize, obj_no);
end
Archive_mem_ranks=RankingProcess(Archive_F, ArchiveMaxSize, obj_no);
index=RouletteWheelSelection(1./Archive_mem_ranks);
if index==-1
index=1;
end
TargetFitness=Archive_F(index,:);
TargetPosition=Archive_X(index,:)';
c=cMax-iter*((cMax-cMin)/max_iter); % Eq. (3.8) in the paper
for i=1:N
temp= GrassHopperPositions;
for k=1:2:dim
S_i=zeros(2,1);
for j=1:N
if i~=j
Dist=distance(temp(k:k+1,j), temp(k:k+1,i));
r_ij_vec=(temp(k:k+1,j)-temp(k:k+1,i))/(Dist+eps);
xj_xi=2+rem(Dist,2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Eq. (3.2) in the paper
s_ij=((ub(k:k+1)' - lb(k:k+1)') .*c/2)*S_func(xj_xi).*r_ij_vec;
S_i=S_i+s_ij;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
end
S_i_total(k:k+1, :) = S_i;
end
X_new=c*S_i_total'+(TargetPosition)'; % Eq. (3.7) in the paper
GrassHopperPositions_temp(i,:)=X_new';
end
% GrassHopperPositions
GrassHopperPositions=GrassHopperPositions_temp';
display(['At the iteration ', num2str(iter), ' there are ', num2str(Archive_member_no), ' non-dominated solutions in the archive']);
end if (flag==1)
TargetPosition = TargetPosition(1:dim-1);
endfigure
Draw_ZDT1();
hold on
plot(Archive_F(:,1),Archive_F(:,2),'ro','MarkerSize',8,'markerfacecolor','k');
legend('True PF','Obtained PF');
title('MOGOA');set(gcf, 'pos', [403 466 230 200])