您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 多目标粒子群算法matlab源代码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%¸Ä½øµÄ¶àÄ¿±êÁ£×ÓȺËã·¨£¬°üÀ¨¶à¸ö²âÊÔº¯Êý%¶Ô³ÌÐòÖеIJ¿·Ö²ÎÊý½øÐÐÐ޸Ľ«¸üºÃµØÇó½âijЩº¯Êý%³ÌÐòÖеÄËùÓдúÂ붼ÊDZ¾È˸ù¾Ý¶àÄ¿±êÁ£×ÓȺËã·¨Éè¼ÆʵÏÖµÄ%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,30),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:50tic;%[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=cell2mat(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,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,nprule,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',num2str(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,zeros(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=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP1',0.1,50,100,2.0,1.0,0.4,1500,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[],struct('isfmopso',false,'istargetdis',false,'stopatborder',true));%--CTP1elapsedTime=toc;CTP1NP(i)={np};CTP1FV(i)={fv};CTP1T(i)=elapsedTime;display(strcat('CTP1',num2str(i)));endctp1fv=cell2mat(CTP1FV');ctp1fv=GetLeastFunctionValue(ctp1fv);CTP1fmNP=cell(1,50);CTP1fmFV=cell(1,50);CTP1fmT=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP1',0.1,50,100,2.0,1.0,0.4,400,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[00000],struct('isfmopso',true,'istargetdis',false,'stopatborder',true));%--CTP1elapsedTime=toc;CTP1fmNP(i)={np};CTP1fmFV(i)={fv};CTP1fmT(i)=elapsedTime;display(strcat('CTP1fm',num2str(i)));endctp1fmfv=cell2mat(CTP1fmFV');ctp1fmfv=GetLeastFunctionValue(ctp1fmfv);CTP2NP=cell(1,50);CTP2FV=cell(1,50);CTP2T=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP2',0.1,50,100,2.0,1.0,0.4,1500,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[],struct('isfmopso',false,'istargetdis',false,'stopatborder',true));%--CTP2elapsedTime=toc;CTP2NP(i)={np};CTP2FV(i)={fv};CTP2T(i)=elapsedTime;display(strcat('CTP2',num2str(i)));endctp2fv=cell2mat(CTP2FV');ctp2fv=GetLeastFunctionValue(ctp2fv);CTP2fmNP=cell(1,50);CTP2fmFV=cell(1,50);CTP2fmT=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP2',0.1,50,100,2.0,1.0,0.4,400,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[00000],struct('isfmopso',true,'istargetdis',false,'stopatborder',true));%--CTP2elapsedTime=toc;CTP2fmNP(i)={np};CTP2fmFV(i)={fv};CTP2fmT(i)=elapsedTime;display(strcat('CTP2fm',num2str(i)));endctp2fmfv=cell2mat(CTP2fmFV');ctp2fmfv=GetLeastFunctionValue(ctp2fmfv);CTP3NP=cell(1,50);CTP3FV=cell(1,50);CTP3T=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP3',0.1,50,100,2.0,1.0,0.4,1400,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[],struct('isfmopso',false,'istargetdis',false,'stopatborder',true));%--CTP3elapsedTime=toc;CTP3NP(i)={np};CTP3FV(i)={fv};CTP3T(i)=elapsedTime;display(strcat('CTP3',num2str(i)));endctp3fv=cell2mat(CTP3FV');ctp3fv=GetLeastFunctionValue(ctp3fv);CTP3fmNP=cell(1,50);CTP3fmFV=cell(1,50);CTP3fmT=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP3',0.1,50,100,2.0,1.0,0.4,400,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[00000],struct('isfmopso',true,'istargetdis',false,'stopatborder',true));%--CTP3elapsedTime=toc;CTP3fmNP(i)={np};CTP3fmFV(i)={fv};CTP3fmT(i)=elapsedTime;display(strcat('CTP3fm',num2str(i)));endctp3fmfv=cell2mat(CTP3fmFV');ctp3fmfv=GetLeastFunctionValue(ctp3fmfv);CTP4NP=cell(1,50);CTP4FV=cell(1,50);CTP4T=zeros(1,50);fori=1:50tic;[np,nprule,dnp,fv,goals,pbest]=ParticleSwarmOpt('CTP4',0.1,50,100,2.0,1.0,0.4,1400,5,[0,-5,-5,-5,-5],[1,5,5,5,5],[],struct('isfmopso',false,'istargetdis',false,'stopatborder',true));%--CTP4elapsedTime=toc;CTP4NP(i)={np};CTP4FV(i)={fv};CTP4T(i)=elapsedTime;display
本文标题:多目标粒子群算法matlab源代码
链接地址:https://www.777doc.com/doc-7286600 .html