-
大小: 5KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-11
- 語言: Matlab
- 標(biāo)簽:
資源簡介
Chicken Swarm Optimization(CSO)雞群優(yōu)化算法,2014年提出的群智能優(yōu)化算法。 Bird Swarm Algorithm(BSA)鳥群算法,2015年最新的群智能優(yōu)化算法。 作為兩種全新的群智能優(yōu)化算法,CSO和BSA都具有簡單,良好擴(kuò)展性的特點,是天然的多種群算法! http://cn.mathworks.com/matlabce ... 7597-xian-bing-meng 有關(guān)算法信息,可在上述網(wǎng)站查詢。 希望對大家有用!

代碼片段和文件信息
%?------------------------------------------------------------------------
%?Bird?Swarm?Algorithm?(BSA)?(demo)
%?Programmed?by?Xian-Bing?Meng
%?Updated?at?Jun?19?2015.????
%?Email:?x.b.meng12@gmail.com
%
%?This?is?a?simple?demo?version?only?implemented?the?basic?idea?of?BSA?for????????
%?solving?the?unconstrained?problem?namely?Sphere?function.??
%
%?The?details?about?BSA?are?illustratred?in?the?following?paper.????
%?Xian-Bing?Meng?et?al?(2015):?A?new?bio-inspXred?optimisation?algorithm:?
%?Bird?Swarm?Algorithm?Journal?of?Experimental?&?Theoretical
%?Artificial?Intelligence?DOI:?10.1080/0952813X.2015.1042530
%
%?The?parameters?in?BSA?are?presented?as?follows.
%?FitFunc????%?The?objective?function
%?M??????????%?Maxmimal?generations?(iterations)
%?pop????????%?Population?size
%?dim????????%?Dimension
%?FQ?????????%?The?frequency?of?birds‘?flight?behaviours?
%?c1?????????%?Cognitive?accelerated?coefficient
%?c2?????????%?Social?accelerated?coefficient
%?a1?a2?????%?Two?paramters?which?are?related?to?the?indirect?and?direct?
%??????????????effect?on?the?birds‘?vigilance?bahaviors.
%
%?Using?the?default?value?BSA?can?be?executed?using?the?following?code.
%?[?bestX?fMin?]?=?BSA
%?------------------------------------------------------------------------
?
%?Main?programs
function?[?bestX?fMin?]?=?BSA(?FitFunc?M?pop?dim?FQ?c1?c2?a1?a2?)
%?Display?help
help?BSA.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?set?the?default?parameters
if?nargin?1
????FitFunc?=?@Sphere;
????M?=?1000;???
????pop?=?30;??
????dim?=?20;???
????FQ?=?10;???
????c1?=?1.5;
????c2?=?1.5;
????a1?=?1;
????a2?=?1;
end
%?set?the?parameters
lb=?-100*ones(?1dim?);???%?Lower?bounds
ub=?100*ones(?1dim?);????%?Upper?bounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Initialization
for?i?=?1?:?pop
????x(?i?:?)?=?lb?+?(ub?-?lb)?.*?rand(?1?dim?);?
????fit(?i?)?=?FitFunc(?x(?i?:?)?);?
end
pFit?=?fit;?%?The?individual‘s?best?fitness?value
pX?=?x;?????%?The?individual‘s?best?position?corresponding?to?the?pFit
[?fMin?bestIndex?]?=?min(?fit?);??%?fMin?denotes?the?global?optimum
%?bestX?denotes?the?position?corresponding?to?fMin
bestX?=?x(?bestIndex?:?);???
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Start?the?iteration.
?for?iteration?=?1?:?M
?????
????prob?=?rand(?pop?1?)?.*?0.2?+?0.8;%The?probability?of?foraging?for?food
????
????if(?mod(?iteration?FQ?)?~=?0?)?????????
????????%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
????????%?Birds?forage?for?food?or?keep?vigilance
????????sumPfit?=?sum(?pFit?);
????????meanP?=?mean(?pX?);
????????for?i?=?1?:?pop
????????????if?rand?????????????????x(?i?:?)?=?x(?i?:?)?+?c1?*?rand.*(bestX?-?x(?i?:?))+?...
????????????????????c2?*?rand.*(?pX(i:)?-?x(?i?:?)?);
????????????else
????????????????person?=?randiTabu(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????10236??2015-06-21?12:53??CSO.m
?????文件???????7744??2015-06-21?10:39??BSA.m
?????文件??????????0??2018-12-08?10:13??readme.txt
-----------?---------??----------?-----??----
????????????????17980????????????????????3
評論
共有 條評論