91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-28
  • 語言: Matlab
  • 標簽: matlab??

資源簡介

參數自適應 差分 進化算法 遺傳算法 matlab

資源截圖

代碼片段和文件信息

function?[trbjbmn]?=?SACPMDE(VTRXVminXVmaxDNPfname)
%?參數自適應差分進化算法對Rastrigrin函數起作用
%?aa?????當前計算到第幾次
%?VTR????優化的目標值
%?fname??選擇測試函數
%?XVmin??搜索空間下限
%?XVmax??搜索空間上限
itermax?=?8000;????????????%?maximum?number?of?iterations?(generations)
F?=?0.6;??????????????????%?DE-stepsize?F?from?interval?[0?2]
F1=0.45;
CR?=?0.9;?????????????????%?crossover?probability?constant?from?interval?[0?1]
%-----DE?Initialize--------------------------------------------------------
pop?=?zeros(NPD);????????%?initialize?pop
for?i?=?1:NP
???pop(i:)?=?XVmin?+?rand(1D).*(XVmax?-?XVmin);
end
popold?=?zeros(size(pop));%?toggle?population
val?=?zeros(1NP);????????%?create?and?reset?the?“cost?array“
bestmem?=?zeros(1D);?????%?best?population?member?ever
bestmemit?=?zeros(1D);???%?best?population?member?in?iteration
for?i?=?1:NP??????????????%?Evaluate?the?best?member?after?initialization
????input?=?pop(i:);
????output(i)?=?feval(fnameinput);
end
val?=?output‘;
[bestvalitidx]?=?min(val);
bestmemit?=?pop(idx:);???%?best?member?of?current?iteration
bestmem?=?bestmemit;??????%?best?member?ever
bestval?=?bestvalit;??????%?best?value?ever
%-----DE?Iteration---------------------------------------------------------
tr?=?zeros(1itermax);
for?j?=?1:itermax
????if?(bestval-VTR)?????????break
????end???
????popold?=?pop;
????%?generate?the?trail?population
????for?i?=?1:NP

????????%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
????????CR=0.1;
????????if?val(i)<=mean(val)
???????????CR=0.1+(0.6-0.1)*(val(i)-max(val))/(min(val)-max(val));?
????????end?????
????????%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

????????%?pick?up?the?donor?and?differential?vectors
????????rd?=?fix(rand(1)?*?NP?+?1);
????????while?val(rd)?>?val(i)
????????????rd?=?fix(rand(1)?*?NP?+?1);
????????end
????????rb?=?fix(rand(1)?*?NP?+?1);
????????while?rb?==?i?||?rb?==?rd
?????????????rb?=?fix(rand(1)?*?NP?+?1);
????????end
????????rc?=?fix(rand(1)?*?NP?+?1);
????????while?rc?==?i?||?rc?==?rd?||?rc==rb
?????????????rc?=?fix(rand(1)?*?NP?+?1);
????????end
????????re?=?fix(rand(1)?*?NP?+?1);
????????while?re?==?i?||?re?==?rd?||?re==rb??||?re==rc
?????????????re?=?fix(rand(1)?*?NP?+?1);
????????end
????????%?bulid?a?trial?vector?and?crossover
????????jr?=?fix(rand(1)?*?D?+?1);

????????%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
????????%?找基變量
????????tb=rd;
????????if?val(rb:)<=min(val(rd:)val(rc:))
???????????tb=rb;
????????end
????????if?val(rc:)<=min(val(rd:)val(rb:))
???????????tb=rc;
????????end
????????%?找另兩個差分向量;
????????tm=rd;
????????if?val(rb:)>=min(val(rd:)val(rc:))?&&?val(rb:)<=max(val(rd:)val(rc:))
???????????tm=rb;
????????end
????????if?val(rc:)>=min(val(rd:)val(rb:))?&&?val(rc:)<=max(val(rd:)val(rb:))
????????????tm=rc;
????????end
????????%?找最差的向量
????????tw=rd;
????????if?val(rb:)>=max(val(rd:)val(rc:))
???????????tw=rb;
????????end
????????if?val(rc:)>=max(val(rd:)val(rb:))
?????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-09-11?10:16??參數自適應差分進化算法\
?????文件??????????55??2018-08-27?11:33??參數自適應差分進化算法\【源碼使用必讀】.url
?????文件????????4326??2009-05-05?10:13??參數自適應差分進化算法\SACPMDE.m

評論

共有 條評論