资源描述:
《多目标粒子群matlab代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%改进的多目标粒子群算法,包括多个测试函数%对程序中的部分参数进行修改将更好地求解某些函数%ZDT1NP=cell(1,50);ZDT1FV=cell(1,50);ZDT1T=zeros(1,50);fori=1:50tic;%[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('ZDT1',0.1,50,100,2.0,1.0,0.4,200,30,zeros(1,3
2、0),ones(1,30));%--ZDT1elapsedTime=toc;ZDT1NP(i)={np};ZDT1FV(i)={fv};ZDT1T(i)=elapsedTime;display(strcat('ZDT1',num2str(i)));endzdt1fv=cell2mat(ZDT1FV');zdt1fv=GetLeastFunctionValue(zdt1fv);ZDT2NP=cell(1,50);ZDT2FV=cell(1,50);ZDT2T=zeros(1,50);fori=1:50
3、tic;%[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('ZDT2',0.1,50,100,2.0,1.0,0.4,200,30,zeros(1,30),ones(1,30),[1,zeros(1,29)]);%--ZDT2elapsedTime=toc;ZDT2NP(i)={np};ZDT2FV(i)={fv};ZDT2T(i)=elapsedTime;display(strcat('ZDT2',num2str(i)));endzdt2fv=cel
4、l2mat(ZDT2FV');zdt2fv=GetLeastFunctionValue(zdt2fv);%%%%%%%%%%%%%%%%%%%%%%%%%%%5ZDT3NP=cell(1,50);ZDT3FV=cell(1,50);ZDT3T=zeros(1,50);fori=1:50tic;%[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('ZDT3',0.1,50,100,2.0,1.0,0.4,400,30,zeros(1,30),ones(1,
5、30));%--ZDT3elapsedTime=toc;ZDT3NP(i)={np};ZDT3FV(i)={fv};ZDT3T(i)=elapsedTime;display(strcat('ZDT3',num2str(i)));endzdt3fv=cell2mat(ZDT3FV');zdt3fv=GetLeastFunctionValue(zdt3fv);ZDT4NP=cell(1,50);ZDT4FV=cell(1,50);ZDT4T=zeros(1,50);fori=1:50tic;%[np,n
6、prule,dnp,fv,goals]=ParticleSwarmOpt('ZDT4',0.1,50,100,2.0,1.0,0.4,200,10,[0,-5,-5,-5,-5,-5,-5,-5,-5,-5],[1,5,5,5,5,5,5,5,5,5],[1,0,0,0,0,0,0,0,0,0]);%--ZDT4elapsedTime=toc;ZDT4NP(i)={np};ZDT4FV(i)={fv};ZDT4T(i)=elapsedTime;display(strcat('ZDT4',num2st
7、r(i)));endzdt4fv=cell2mat(ZDT4FV');zdt4fv=GetLeastFunctionValue(zdt4fv);%%%%%%%%%%%%%%%%%%%%%%%%ZDT6NP=cell(1,50);ZDT6FV=cell(1,50);ZDT6T=zeros(1,50);fori=1:50tic;%[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('ZDT6',0.1,50,100,2.0,1.0,0.4,200,10,zer
8、os(1,10),ones(1,10));%--ZDT6elapsedTime=toc;ZDT6NP(i)={np};ZDT6FV(i)={fv};ZDT6T(i)=elapsedTime;display(strcat('ZDT6',num2str(i)));endzdt6fv=cell2mat(ZDT6FV');zdt6fv=GetLeastFunctionValue(zdt6fv);CTP1NP=cell(1,50);CTP1FV=cell(1,50);CTP1T