资源简介
粒子群算法 PSO matlab toolbox 工具箱
有多个测试函数,动态图形显示。。。

代码片段和文件信息
% demopsobehavior.m
% demo of the pso.m function
% the pso tries to find the minimum of the f6 function a standard
% benchmark
%
% on the plots blue is current position green is Pbest and red is Gbest
% Brian Birge
% Rev 3.0
% 2/27/06
clear all
close all
clc
help demopsobehavior
warning off
functnames = {‘ackley‘‘alpine‘‘DeJong_f2‘‘DeJong_f3‘‘DeJong_f4‘...
‘Foxhole‘‘Griewank‘‘NDparabola‘...
‘Rastrigin‘‘Rosenbrock‘‘f6‘‘f6mod‘‘tripod‘...
‘f6_bubbles_dyn‘‘f6_linear_dyn‘‘f6_spiral_dyn‘};
disp(‘Static test functions minima don‘‘t change w.r.t. time/iteration:‘);
disp(‘ 1) Ackley‘);
disp(‘ 2) Alpine‘);
disp(‘ 3) DeJong_f2‘);
disp(‘ 4) DeJong_f3‘);
disp(‘ 5) DeJong_f4‘);
disp(‘ 6) Foxhole‘);
disp(‘ 7) Griewank‘);
disp(‘ 8) NDparabola (for this demo N = 2)‘);
disp(‘ 9) Rastrigin‘);
disp(‘10) Rosenbrock‘);
disp(‘11) Schaffer f6‘);
disp(‘12) Schaffer f6 modified (5 f6 functions translated from each other)‘);
disp(‘13) Tripod‘);
disp(‘ ‘);
disp(‘Dynamic test functions minima/environment evolves over time/iteration:‘);
disp(‘14) f6_bubbles_dyn‘);
disp(‘15) f6_linear_dyn‘);
disp(‘16) f6_spiral_dyn‘);
functchc=input(‘Choose test function ? ‘);
functname = functnames{functchc};
disp(‘ ‘);
disp(‘1) Intense graphics shows error topology and surfing particles‘);
disp(‘2) Default PSO graphing shows error trend and particle dynamics‘);
disp(‘3) no plot only final output shown fastest‘);
plotfcn=input(‘Choose plotting function ? ‘);
if plotfcn == 1
plotfcn = ‘goplotpso4demo‘;
shw = 1; % how often to update display
elseif plotfcn == 2
plotfcn = ‘goplotpso‘;
shw = 1; % how often to update display
else
plotfcn = ‘goplotpso‘;
shw = 0; % how often to update display
end
% set flag for ‘dynamic function on‘ only used at very end for tracking plots
dyn_on = 0;
if functchc==15 | functchc == 16 | functchc == 17
dyn_on = 1;
end
%xrng=input(‘Input search range for X e.g. [-1010] ? ‘);
%yrng=input(‘Input search range for Y ? ‘);
xrng=[-3030];
yrng=[-4040];
disp(‘ ‘);
% if =0 then we look for minimum =1 then max
disp(‘0) Minimize‘)
disp(‘1) Maximize‘)
minmax=input(‘Choose search goal ?‘);
% minmax=0;
disp(‘ ‘);
mvden = input(‘Max velocity divisor (2 is a good choice) ? ‘);
disp(‘ ‘);
ps = input(‘How many particles (24 - 30 is common)? ‘);
disp(‘ ‘);
disp(‘0) Common PSO - with inertia‘);
disp(‘1) Trelea model 1‘);
disp(‘2) Trelea model 2‘);
disp(‘3) Clerc Type 1“ - with constriction‘);
modl = input(‘Choose PSO model ? ‘);
% note: if errgoal=NaN then unconstrained min or max is performed
if minmax==1
% errgoal=0.97643183; % max for f6 function (close enough for termination)
errgoal=NaN;
else
% errgoal=0; % min
errgoal=NaN;
end
minx = xrng(1);
maxx = xrng(2);
miny = yrng(1);
maxy = yrng(2);
%----
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 741121 2003-05-22 12:25 A Particle Swarm Optimization (PSO) Primer.pdf
文件 4862 2006-03-06 15:54 DemoPSOBehavior.m
文件 4387 2006-03-17 16:44 ReadME.txt
文件 5788 2006-03-14 15:42 goplotpso.m
文件 4899 2006-03-06 13:46 goplotpso4demo.m
目录 0 2009-06-25 20:08 hiddenutils\
文件 172 2004-04-27 19:05 hiddenutils\forcecol.m
文件 181 2004-04-27 19:05 hiddenutils\forcerow.m
文件 749 2004-08-23 19:41 hiddenutils\linear_dyn.m
文件 4588 2006-03-17 15:52 hiddenutils\normmat.m
文件 841 2004-08-27 19:51 hiddenutils\spiral_dyn.m
文件 1332 2009-06-25 20:08 license.txt
目录 0 2009-06-25 20:08 nnet\
文件 1857 2006-03-17 16:32 nnet\demoPSOnet.m
文件 7808 2006-03-15 03:26 nnet\goplotpso4net.m
文件 836 2006-03-11 03:24 nnet\pso_neteval.m
文件 11664 2006-03-17 16:01 nnet\trainpso.m
文件 22223 2006-03-17 15:42 pso_Trelea_vectorized.m
目录 0 2009-06-25 20:08 testfunctions\
文件 871 2004-08-23 17:42 testfunctions\ackley.m
文件 639 2004-08-19 19:40 testfunctions\alpine.m
文件 732 2004-08-13 17:06 testfunctions\DeJong_f2.m
文件 506 2004-08-19 19:39 testfunctions\DeJong_f3.m
文件 1004 2004-08-13 17:17 testfunctions\DeJong_f4.m
文件 314 2005-06-27 17:02 testfunctions\f6.m
文件 700 2004-08-23 17:42 testfunctions\f6mod.m
文件 1510 2004-08-26 17:16 testfunctions\f6_bubbles_dyn.m
文件 617 2006-02-27 21:39 testfunctions\f6_linear_dyn.m
文件 872 2006-02-27 21:39 testfunctions\f6_spiral_dyn.m
文件 1278 2004-08-13 19:48 testfunctions\Foxhole.m
文件 1214 2004-08-13 15:02 testfunctions\Griewank.m
............此处省略4个文件信息
- 上一篇:头脑风暴算法MATLAB版本
- 下一篇:16QAM_Viterbi_soft.rar
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论