资源简介
竞争群(competitive swarm optimizer (CSO))算法的matlab代码实现。(包含函数和例子)

代码片段和文件信息
function [ bestever bestSwarm ] = cso( varargin )
% Implementation of a competitive swarm optimizer (CSO) for large scale optimization
%
% See the details of CSO in the following paper
% R. Cheng and Y. Jin A Competitive Swarm Optimizer for Large Scale Optmization
% IEEE Transactions on Cybernetics 2014
%
% The test instances are the CEC‘08 benchmark functions for large scale optimization
%
% The source code CSO is implemented by Ran Cheng
%
% If you have any questions about the code please contact:
% Ran Cheng at r.cheng@surrey.ac.uk
% Prof. Yaochu Jin at yaochu.jin@surrey.ac.uk
%
% Code update on 2018-03-18
% A.Star Snowland Co. Ltd chenxiaolong12315@163.com
%
% [res bestSwarm] = cso(fitness_function XRRmin XRRmax maxfe)
% input args
% fitness: a function handle to calculate the fitness of swarms(popsize x dim matrix)
% popsize: integer the popsize of swarm
% bound_min bound_max: the matrix(1 x dim) is the bounary of the swarms
% maxfe: a integer number of iterations
% debug: default 0 display bestfitness in each iteration
% output args
% Example:
% fun=inline(‘sqrt(x(:1).^2+x(:2).^2)‘‘x‘);
% [res swarm] = cso(fun100[-8-8][88]10000.2);
% xi = -8:0.05:8;
% yi = -8:0.05:8;
% [xy] = meshgrid(xi yi);
% z = sqrt(x.^2+y.^2);
% mesh(xyz);
% hold on
% plot3(swarm(1)swarm(2) res ‘r+‘)
[fitness_functionm bound_min bound_max maxfe phi debug] = checkInput(varargin);
XRRmin = repmat(bound_min m 1);
XRRmax = repmat(bound_max m 1);
[~ d] = size(XRRmin);
%% initialization
p = XRRmin + (XRRmax - XRRmin) .* rand(m d);
v = zeros(md);
bestever = 1e200;
fitness = fitness_function(p);
FES = m;
gen = 0;
bestSwarm = p(1:);
ceil_half_m = ceil(m/2);
%% main loop
while(FES < maxfe)
% generate random pairs
rlist = randperm(m);
rpairs = [rlist(1:ceil_half_m); rlist(floor(m/2) + 1:m)]‘;
% calculate the center position
center = ones(ceil_half_m1)*mean(p);
% do pairwise competitions
mask = (fitness(rpairs(:1)) > fitness(rpairs(:2)));
losers = mask.*rpairs(:1) + ~mask.*rpairs(:2);
winners = ~mask.*rpairs(:1) + mask.*rpairs(:2);
%random matrix
randco1 = rand(ceil_half_m d);
randco2 = rand(ceil_half_m d);
randco3 = rand(ceil_half_m d);
% losers learn from winners
v(losers:) = randco1.*v(losers:) ...
+ randco2.*(p(winners:) - p(losers:)) ...
+ phi*randco3.*(center - p(losers:));
p(losers:) = p(losers:) + v(losers:);
% boundary control
for i = 1:ceil_half_m
p(losers(i):) = max(p(losers(i):) XRRmin(losers(i):));
p(losers(i):) = min(p(losers(i):) XRRmax(losers(i):));
end
% fitness evaluation
fitness(losers:) = fitness_function(p(losers:));
[min_fitness min_fitness_ind] = min(fitness);
if bestever > min_fitness
bestever = min_fitness;
bestSwarm = p(min_fitness_ind
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-19 09:38 CSO_Matlab-master\
目录 0 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\
文件 37430 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\FractalFunctions.jar
文件 7840 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\ackley_shift_func_data.mat
文件 3497 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\benchmark_func.m
文件 171 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\fastfractal_doubledip_data.mat
文件 195 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\fbias_data.mat
文件 7817 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\griewank_shift_func_data.mat
文件 7914 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\rastrigin_shift_func_data.mat
文件 7831 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\rosenbrock_shift_func_data.mat
文件 7751 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\schwefel_shift_func_data.mat
文件 7826 2018-03-19 09:38 CSO_Matlab-master\CEC08 Func\sphere_shift_func_data.mat
文件 3431 2018-03-19 09:38 CSO_Matlab-master\CSO.m
文件 3176 2018-03-19 09:38 CSO_Matlab-master\CSO_test.m
文件 255 2018-03-19 09:38 CSO_Matlab-master\cso_test_hat.m
- 上一篇:阶比跟踪谱
- 下一篇:matlab中基于Viola-Jones算法的人脸检测
相关资源
- 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
- k近邻算法matlab实现
评论
共有 条评论