资源简介
GCSO.m
代码片段和文件信息
% -------------------------------------------------------------------------
% Chicken Swarm Optimization (CSO) (demo)
% Programmed by Xian-Bing Meng
% Updated at Jun 21 2015.
% Email: x.b.meng12@gmail.com
%
% This is a simple demo version only implemented the basic idea of CSO for
% solving the unconstrained problem namely Sphere function.
% The details about CSO are illustratred in the following paper.
% Xian-Bing Meng et al. A new bio-inspired algorithm: Chicken Swarm
% Optimization. The Fifth International Conference on Swarm Intelligence
%
% The parameters in CSO are presented as follows.
% FitFunc % The objective function
% M % Maxmimal generations (iterations)
% pop % Population size
% dim % Dimension
% G % How often the chicken swarm can be updated.
% rPercent % The population size of roosters accounts for “rPercent“
% percent of the total population size
% hPercent % The population size of hens accounts for “hPercent“ percent
% of the total population size
% mPercent % The population size of mother hens accounts for “mPercent“
% percent of the population size of hens
%
% Using the default valueCSO can be executed using the following code.
% [ bestX fMin ] = CSO
% -------------------------------------------------------------------------
%*************************************************************************
% Revision 1
% Revised at May 23 2015
% 1.Note that the previous version of CSO doen‘t consider the situation
% that there maybe not exist hens in a group.
% We assume there exist at least one hen in each group.
% Revision 2
% Revised at Jun 24 2015
% 1.Correct an error at line “100“.
%*************************************************************************
% Main programs
function [ bestX yy ] =GCSO( FitFunc M pop dim G rPercent hPercent mPercent )
% Display help
help GCSO.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set the default parameters
if nargin < 1
FitFunc = @Sphere;
M = 1000;
pop = 100;
dim = 20;
G = 10;
rPercent = 0.2;
hPercent = 0.6;
mPercent = 0.6;
end
rNum = round( pop * rPercent ); % The population size of roosters
hNum = round( pop * hPercent ); % The population size of hens
cNum = pop - rNum - hNum; % The population size of chicks
mNum = round( hNum * mPercent ); % The population size of mother hens
lb= -100*ones( 1dim ); % Lower bounds
ub= 100*ones( 1dim ); % Upper bounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Initialization
for i = 1 : pop
x( i : ) = lb + (ub - lb) .* rand( 1 dim );
fit( i ) = FitFunc( x( i : ) );
end
pFit = fit; % The individual‘s best fitness value
pX = x; % The individual‘s best position corresponding
- 上一篇:二维DOA估计中的ROOTMUSIC算法
- 下一篇:信噪比matlab代码
相关资源
- C4.5算法matlab实现以及西瓜数据集.ra
- Matlab仿真_高勇.caj
- guangfu.mdl
- 无人驾驶车辆模型预测控制配套matl
- DVR.mdl
- 基于MATLAB的同步发电机励磁系统仿真
- MATLAB仿真[张雪英][程序源代码].rar
- Matlab学习视频.txt
- quan.mdl
- writetxt.m
- M_M_1.m
- Matlab2018aMacISO.txt
- SAR_Figure_7_5.m
- SAR_Figure_5_18.m
- SAR_Figure_5_16.m
- SAR_Figure_5_17.m
- MATLAB2019A破解版百度云链接(已亲测
- Matlab2018B破解版云盘链接.rar
- chap2_3.m
- MATLAB控制系统仿真与详解附书光盘.
- 使用Matlab解析HEX386格式数据.zip
- 交通灯信号控制系统02.ms10
- OFDM图.m
- FxNewton.m
- yalmipmatlab解决UC问题范例1补充.rar
- SAM_SSD.m
- 三个参与主体演化博弈matlab.docx
- LM.m
- 二维粒子群算法的matlab源程序.docx.z
- open_file.m
评论
共有 条评论