资源简介
布谷鸟搜索算法源程序,涉及到莱维飞行公式
代码片段和文件信息
function [bestnestfmin]=cuckoo_search_new(n)
clc
clear
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
N_IterTotal=1000;
%% Simple bounds of the search domain
% Lower bounds
decisionNum=2;
Lb=-5*ones(1decisionNum);
% Upper bounds
Ub=5*ones(1decisionNum);
% 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
for iter=1:N_IterTotal
% Generate new solutions (but keep the current best)
new_nest=get_cuckoos(nestbestnestLbUb);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4494 2014-03-23 20:27 cuckoo_search.m
评论
共有 条评论