資源簡介
布谷鳥搜索算法源程序,涉及到萊維飛行公式
代碼片段和文件信息
??????????????????????
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
評論
共有 條評論