资源简介
CLPSO 算法的matlab代码,基于文章而来,非得凑五十个字吗
代码片段和文件信息
%modified by Tang 2007-05-14 at Tongji University
function [gbest_tgbestval_tfitcount]= CLPSO(fhdMax_GenMax_FESParticle_NumberDimensionVRminVRmax)
%[gbestgbestvalfitcount]= CLPSO_new_func(‘f8‘35002000003030-5.125.12)
rand(‘state‘sum(100*clock));
%=============================================================
me=Max_Gen;
ps=Particle_Number;%population size
D=Dimension;
t=0:1/(ps-1):1;t=5.*t;
%Pc=0.0+(0.5-0.0).*(exp(t)-exp(t(1)))./(exp(t(ps))-exp(t(1))); %Learning proportion Pc which determines how many dimensions are chosen to learn from other particles‘ pbests.
Pc=0.05+0.45.*(exp(t)-exp(t(1)))./(exp(t(ps))-exp(t(1)));
% Pc=0.5.*ones(1ps);
dm=3*ones(ps1); %m dimensions are randomly chosen to learn from the gbest. Some of the remaining D-m dimensions are randomly chosen to learn from some randomly chosen particles‘ pbests and the remaining dimensions learn from its pbest
iwt=0.9-(1:me)*(0.7/me);%inertia weight
% iwt=0.729-(1:me)*(0.0/me);
cc=[1.49445 1.49445]; %acceleration constants
if length(VRmin)==1
VRmin=repmat(VRmin1D);
VRmax=repmat(VRmax1D);
end
mv=0.2*(VRmax-VRmin);%max velocity
VRmin=repmat(VRminps1);
VRmax=repmat(VRmaxps1);
Vmin=repmat(-mvps1);
Vmax=-Vmin;
pos=VRmin+(VRmax-VRmin).*rand(psD); %initialize the position value
for i=1:ps;
e(i1)=feval(fhdpos(i:)); %initialize the fitness value
end
fitcount=ps;
vel=Vmin+2.*Vmax.*rand(psD); %initialize the velocity of the particles
pbest=pos; %initialize the pbest (psXD)
pbestval=e; %initialize the pbest‘s fitness value
[gbestvalgbestid]=min(pbestval); %initialize the gbest‘s fitness value
gbestval_t(1)=gbestval; %initialize the pbest‘s fitness value
gbest=pbest(gbestid:); %initialize the gbest value (1XD)
gbestrep=repmat(gbestps1);
gbest_t(1:)=gbest; %
stay_num=zeros(ps1);
ai=zeros(psD);
f_pbest=1:ps;f_pbest=repmat(f_pbest‘1D);
for k=1:ps
ar=randperm(D);%??????????
ai(kar(1:dm(k)))=1;
fi1=ceil(ps*rand(1D));
fi2=ceil(ps*rand(1D));
fi=(pbestval(fi1)=pbestval(fi2))‘.*fi2;
bi=ceil(rand(1D)-1+Pc(k));
if bi==zeros(1D)
rc=randperm(D);
bi(rc(1))=1;
end
f_pbest(k:)=bi.*fi+(1-bi).*f_pbest(k:);
end
stop_num=0;
i=1;
while i i=i+1;
for k=1:ps;
if stay_num(k)>=5 %????????????
% if round(i/10)==i/10%|stay_num(k)>=5
stay_num(k)=0;
ai(k:)=zeros(1D);
f_pbest(k:)=k.*ones(1D);
ar=randperm(D);
ai(kar(1:dm(k)))=1;
fi1=ceil(ps*rand(1D));
fi2=ceil(ps*rand(1D));
fi=(pbestval(fi1)=pbestval(fi2))‘.*fi2;
bi=ceil(rand(1D)-1+Pc(k));
if bi==zeros(1D)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5242 2009-05-23 18:52 CLPSO\CLPSO.m
文件 1090 2010-11-30 18:30 CLPSO\FitnessFunc.m
文件 2530 2010-12-06 10:33 CLPSO\main.m
目录 0 2011-03-15 19:07 CLPSO
----------- --------- ---------- ----- ----
8862 4
- 上一篇:Mayr电弧模型
- 下一篇:最大似然估计的MATLAB代码
相关资源
- 电动汽车充电的模拟退火PSO算法
- qpso算法matlab代码
- MATLAB——基于PSO工具箱的函数寻优算
- PSO-SVM 粒子算法优化支持向量机MATLA
- PSO优化BP神经网络模型.zip
- PSO算法R实现
- 基于粒子群算法的PID控制器优化设计
- PSO算法-ACKELY函数测试
- 多目标粒子群算法matlab
- 粒子群PSO优化LSSVM的完整程序
- PSO(粒子群算法)MATlab程序
- 经济调度粒子群算法matlab源程序
- PSO-ELM源码
- 标准粒子群算法代码PSO
- PSO 优化径向基神经网络参数
- QPSO 算法
- pso algorithms 粒子群算法
- PSO Toolbox
- pso with wind 40uint
- Takamoli
- 51个城市的TSP问题
- pso优化bp神经网络
- optimal placement of dg
- 多目标粒子群算法
- 细菌觅食算法与粒子群优化算法相结
- PSO测试函数代码
- CEC 2010 PSO测试函数代码
- DPSO离散粒子群算法解决旅行商问题
- PSOGSA_v3
- PSO SVM SVM用于分类时的参数优化
评论
共有 条评论