💥1 概述
进化算法(EA)已被应用,具有解决广泛应用的强大能力,但它一次可以解决一个问题。为了提高效率,进化计算领域的一种新兴研究范式,提出了进化多任务(EMT)。EMT同时解决多个优化任务。EMT的有效性是通过任务间知识转移来改进每个任务的解决方案。多因素进化算法(MFEAs)是第一种解决多任务优化问题的算法。然而,它往往受到负面知识转移问题的影响。为了解决这个问题并提高MFEA的性能,我们建议构建一个代理模型,作为在MFEA中同时优化的辅助任务和目标任务。根据所提方法,代理模型是每个对应目标任务的相关任务,以增强任务间的积极知识转移。此外,代理模型可以减少局部最优的数量,并且结构简单。在基准和真实水库洪水发电问题上进行了实验,以检验所提算法的性能。对几个广泛使用的测试问题的比较实验表明,代理模型作为辅助任务可以显着提高MFEA的性能。
📚2 运行结果
部分代码:
% UBA=32.728; % LBA=-32.728; % A_x=[-32.728:0.1:32.728]; % A_z=-20*exp(-0.2*sqrt((1/1)*(A_x.^2)))-exp((1/1)*(cos(2*pi.*A_x)))+exp(1)+20; %原函数 % A_x=sort(A_x); % hold on; % plot(A_x,A_z,'r-','linewidth',2); %Sphere函数 UBS=100; LBS=-100; S_x=[-100:100]; S_z=S_x.^2; %原函数 S_x=sort(S_x); hold on; plot(S_x,S_z,'r-','linewidth',1.5); % %Rosenbrock % UBS=10; % LBS=-5; % r_x=-5:0.1:10; % r_z=100*r_x.^4+(r_x-1).^2; %原函数 % r_x=sort(r_x); % hold on; % plot(r_x,r_z,'r-','linewidth',1.5); UBR=5.12; LBR=-5.12; % R_x=[-5.12:0.05:5.12]; % R_z=10+(R_x)'.^2-10*cos(2*pi.*(R_x)')+(R_x)'.^2; %原函数 x=rand(205,1); x=sort(x); R_x=LBR+x*(UBR-LBR); R_z=10+(R_x)'.^2-10*cos(2*pi.*(R_x)')+(R_x)'.^2; %原函数 % x=sort(x); figure plot(x,R_z,'b-','linewidth',1.5,'MarkerIndices',1:5:length(R_z)); xlabel('x'); ylabel('y'); axis([0 1 0 70]); result1_SAMTO(1,:)=85*44-mean(SAMTO_new(1).Toall_BestFitss(2:4:20,2:21)); result1_SAMTO(2,:)=85*145-mean(SAMTO_new(1).Toall_BestFitss(4:4:20,2:21)); result2_SAMTO(1,:)=85*44-SAMTO_new(2).Toall_BestFitss(1,:); result2_SAMTO(2,:)=85*97-SAMTO_new(2).Toall_BestFitss(2,:); result3_SAMTO(1,:)=85*97-SAMTO_new(3).Toall_BestFitss(1,:); result3_SAMTO(2,:)=85*145-SAMTO_new(3).Toall_BestFitss(2,:); % ST2T1_2=[global_precent,local_precent(:,1801:3000)]; % save 'ST2T1_2.mat' 'ST2T1_2'; st1t1=mean(ST1T1_2); %Rastrigin function positive transfer to Griewank ST1T1=[]; for i=1:150:3000 ST1T1=[ST1T1,mean(st1t1(i:i+149))]; end plot(ST1T1,'o-','color',[0.8547,0.33,0.10],... 'linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST1T1)); hold on st1t2=mean(ST1T2_2); %Greiwank function positive transfer to Griewank ST1T2=[]; for i=1:150:3000 ST1T2=[ST1T2,mean(st1t2(i:i+149))]; end plot(ST1T2,'*-g','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST1T2)); hold on st2t1=mean(ST2T1_2); ST2T1=[]; for i=1:150:3000 ST2T1=[ST2T1,mean(st2t1(i:i+149))]; end plot(ST2T1,'c->','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST2T1)); hold on st2t2=mean(ST2T2_2); ST2T2=[]; for i=1:150:3000 ST2T2=[ST2T2,mean(st2t2(i:i+149))]; end plot(ST2T2,'m-<','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST2T2)); hold on t1t2=mean(T1T2_2); T1T2=[]; for i=1:150:3000 T1T2=[T1T2,mean(t1t2(i:i+149))]; end plot(T1T2,'b-s','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST2T2)); hold on title('Ankang Reservoir 2003 & 2000'); xlabel('Number of Function Evaluations'); ylabel('Average Positive transfer probability'); legend('The surrogate of T1 positive transfer to T1',... 'The surrogate of T1 positive transfer to T2',... 'The surrogate of T2 positive transfer to T1',... 'The surrogate of T2 positive transfer to T2',... 'T1 positive transfer to T2'); % set(gca,'xticklabel',{'0','4500','9000','13500','18000','22500','27000',... % '31500','36000','40500','45000','49500','54000','58500','63000',... % '67500','72000','76500','81000','85500','90000'}); set(gca,'xticklabel',{'0','9000','18000','27000','36000','45000','54000','63000','72000','81000','90000'});
🌈3 Matlab代码实现
🎉4 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]Shangqi Yang, Yutao Qi, Rui Yang, Xiaoliang Ma, Haibin Zhang (2022) Surrogate assist Multitasking optimization Algorithm