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

  • 大小: 7KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-12
  • 語言: Matlab
  • 標簽:

資源簡介

Comprehensive Learning Particle Swarm Optimizer for Global Optimization of Multimodal Functions文章的MATLAB 代碼

資源截圖

代碼片段和文件信息

%**************************************************************************************************
%Reference:??J.?J.?Liang?A.?K.?Qin?P.?N.?Suganthan?and?S.?Baskar?“Comprehensive
%?????????????????????learning?particle?swarm?optimizer?for?global?optimization?of?multimodal
%?????????????????????functions“?IEEE?Trans.?Evolut.?Comput.?vol.?10?no.?3?pp.?281–295?2006.
%
%?Note:?We?obtained?the?MATLAB?source?code?from?the?authors?and?did?some
%???????????minor?revisions?in?order?to?solve?the?25?benchmark?test?functions
%???????????however?the?main?body?was?not?changed.
%**************************************************************************************************

clc;
clear?all
tic

‘CLPSO‘

format?long;
format?compact;

%?Choose?the?problems?to?be?tested.?Please?note?that?for?test?functions?F7
%?and?F25?the?global?optima?are?out?of?the?initialization?range.?For?these
%?two?test?functions?we?do?not?need?to?judge?whether?the?variable?violates
%?the?boundaries?during?the?evolution?after?the?initialization.
problemSet?=?1:15;
array_all_func?=?[];
outcome_all?=?[];
for?k?=?14
????%?Main?body?which?was?provided?by?the?authors
????F_index?=?problemSet(k)
????[xminxmaxn]?=?f_range(F_index);
????maxFES?=?n*10000;
????me?=?maxFES/40;
????ps?=?40;
????%maxFES?=?n*10000;
????array_all=[];
????outcome?=?[];
????
????%?The?total?number?of?runs
????totalTime?=?25;

????for?time?=?1?:?totalTime
?????????
????????rand(‘state‘?sum(100?*?clock));
????????
???????
????????t?=?0?:?1?/?(ps?-?1)?:?1;
????????t?=?5?.*?t;
????????Pc?=?0.0?+?(0.5?-?0.0)?.*?(exp(t)?-?exp(t(1)))?./?(exp(t(ps))?-?exp(t(1)));
????????m?=?0?.*?ones(ps?1);
????????iwt?=?0.9?-?(1?:?me)?*?(0.7?/?me);
????????cc?=?[1.49445?1.49445];?%acceleration?constants
????????
????????lu?=?[ones(1n)*xmin;ones(1n)*xmax];
????????mv?=?0.2?*?(lu(2?:)?-?lu(1?:));
????????VRmin?=?repmat(lu(1?:)?ps?1);
????????VRmax?=?repmat(lu(2?:)?ps?1);
????????Vmin?=?repmat(-mv?ps?1);
????????Vmax?=?-Vmin;

????????pos?=?VRmin?+?(VRmax?-?VRmin)?.*?rand(ps?n);
????????for?i?=?1:ps
????????????e(i:)?=?f(pos(i:)F_indexn);
????????end;
????????%e?=?benchmark_func(pos?problem?o?A?M?a?alpha?b);
????????
????????fitcount?=?ps;
????????vel?=?Vmin?+?2?.*?Vmax?.*?rand(ps?n);?%initialize?the?velocity?of?the?particles

????????pbest?=?pos;
????????pbestval?=?e;??%initialize?the?pbest?and?the?pbest‘s?fitness?value
????????array?=?[min(pbestval)];

????????[gbestval?gbestid]?=?min(pbestval);
????????gbest?=?pbest(gbestid?:);?%initialize?the?gbest?and?the?gbest‘s?fitness?value
????????gbestrep?=?repmat(gbest?ps?1);

????????stay_num?=?zeros(ps?1);

????????ai?=?zeros(ps?n);
????????f_pbest?=?1?:?ps;
????????f_pbest?=?repmat(f_pbest‘?1?n);
????????for?k?=?1?:?ps
???????????
????????????ar?=?randperm(n);
????????????ai(k?ar(1?:?m(k)))?=?1;
????????????fi1?=?ceil(ps?*?rand(1?n));
????????????fi2?=?ceil(ps?*?

評論

共有 條評論