资源简介
这是原作者写的关于布谷鸟算法的源代码,包含三种情形:给定干扰的;固定迭代次数的;带约束优化的。分享给正在学习的各位

代码片段和文件信息
% -----------------------------------------------------------------
% Cuckoo Search (CS) algorithm by Xin-She Yang and Suash Deb %
% Programmed by Xin-She Yang at Cambridge University %
% Programming dates: Nov 2008 to June 2009 %
% Last revised: Dec 2009 (simplified version for demo only) %
% -----------------------------------------------------------------
% Papers -- Citation Details:
% 1) X.-S. Yang S. Deb Cuckoo search via Levy flights
% in: Proc. of World Congress on Nature & Biologically Inspired
% Computing (NaBIC 2009) December 2009 India
% IEEE Publications USA pp. 210-214 (2009).
% http://arxiv.org/PS_cache/arxiv/pdf/1003/1003.1594v1.pdf
% 2) X.-S. Yang S. Deb Engineering optimization by cuckoo search
% Int. J. Mathematical Modelling and Numerical Optimisation
% Vol. 1 No. 4 330-343 (2010).
% http://arxiv.org/PS_cache/arxiv/pdf/1005/1005.2908v2.pdf
% ----------------------------------------------------------------%
% This demo program only implements a standard version of %
% Cuckoo Search (CS) as the Levy flights and generation of %
% new solutions may use slightly different methods. %
% The pseudo code was given sequentially (select a cuckoo etc) %
% but the implementation here uses Matlab‘s vector capability %
% which results in neater/better codes and shorter running time. %
% This implementation is different and more efficient than the %
% the demo code provided in the book by
% “Yang X. S. Nature-Inspired metaheuristic Algoirthms %
% 2nd Edition Luniver Press (2010). “ %
% --------------------------------------------------------------- %
% =============================================================== %
% Notes: %
% Different implementations may lead to slightly different %
% behavour and/or results but there is nothing wrong with it %
% as this is the nature of random walks and all metaheuristics. %
% -----------------------------------------------------------------
function [bestnestfmin]=cuckoo_search(n)
if nargin<1
% Number of nests (or different solutions)
n=25;
end
% Discovery rate of alien eggs/solutions
pa=0.25;
%% Change this if you want to get better results
% Tolerance
Tol=1.0e-5;
%% Simple bounds of the search domain
% Lower bounds
nd=15;
Lb=-5*ones(1nd);
% Upper bounds
Ub=5*ones(1nd);
% Random initial solutions
for i=1:n
nest(i:)=Lb+(Ub-Lb).*rand(size(Lb));
end
% Get the current best
fitness=10^10*ones(n1);
[fminbestnestnestfitness]=get_best_nest(nestnestfitness);
N_iter=0;
%% Starting iterations
while (fmin>Tol)
% Generate new solutions (but keep the current best)
new_nest=get_cuckoos(nestbestnestLbUb);
[fnewbestnestfitness]=get_best_nest(nestnew_nestfitness);
% Update the counter
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6598 2013-02-10 22:32 cuckoo_search.m
文件 6832 2013-02-10 22:32 cuckoo_search_new.m
文件 5768 2013-02-14 02:19 cuckoo_search_spring.m
文件 1312 2014-02-12 14:17 license.txt
- 上一篇:MATLAB+背景减除目标检测+鱼头截取
- 下一篇:多目标遗传算法matlab程序
相关资源
- 天线阵的波束形成在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实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
- matlab程序用Hopfield网络解决TSP
- 实例matlab 编程100个常用程序
- 用MATLAB(BPSK仿真 直接扩频)
评论
共有 条评论