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

  • 大小: 10KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-09
  • 語言: Matlab
  • 標簽: 雞群算法??CSO??

資源簡介

雞群算法CSO,求最優解,算法程序。。。。。。。。。。。。。。。。。。。。。。。

資源截圖

代碼片段和文件信息

%?-------------------------------------------------------------------------
%?Chicken?Swarm?Optimization?(CSO)?(demo)
%?Programmed?by?Xian-Bing?Meng
%?Updated?at?Jun?21?2015.????
%?Email:?x.b.meng12@gmail.com
%
%?This?is?a?simple?demo?version?only?implemented?the?basic?idea?of?CSO?for????????
%?solving?the?unconstrained?problem?namely?Sphere?function.????
%?The?details?about?CSO?are?illustratred?in?the?following?paper.????????????????????????????????????????????????
%?Xian-Bing?Meng?et?al.?A?new?bio-inspired?algorithm:?Chicken?Swarm?
%????Optimization.?The?Fifth?International?Conference?on?Swarm?Intelligence?
%
%?The?parameters?in?CSO?are?presented?as?follows.
%?FitFunc????%?The?objective?function
%?M??????????%?Maxmimal?generations?(iterations)
%?pop????????%?Population?size
%?dim????????%?Dimension
%?G??????????%?How?often?the?chicken?swarm?can?be?updated.
%?rPercent???%?The?population?size?of?roosters?accounts?for?“rPercent“?
%???percent?of?the?total?population?size
%?hPercent???%?The?population?size?of?hens?accounts?for?“hPercent“?percent?
%??of?the?total?population?size
%?mPercent???%?The?population?size?of?mother?hens?accounts?for?“mPercent“?
%??percent?of?the?population?size?of?hens
%
%?Using?the?default?valueCSO?can?be?executed?using?the?following?code.
%?[?bestX?fMin?]?=?CSO
%?-------------------------------------------------------------------------
?
%*************************************************************************
%?Revision?1
%?Revised?at?May?23?2015
%?1.Note?that?the?previous?version?of?CSO?doen‘t?consider?the?situation?
%???that?there?maybe?not?exist?hens?in?a?group.?
%???We?assume?there?exist?at?least?one?hen?in?each?group.

%?Revision?2
%?Revised?at?Jun?24?2015
%?1.Correct?an?error?at?line?“100“.
%*************************************************************************

%?Main?programs

function?[?bestX?fMin?]?=?CSO(?FitFunc?M?pop?dim?G?rPercent?hPercent?mPercent?)
%?Display?help
help?CSO.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?set?the?default?parameters
if?nargin?????FitFunc?=?@Sphere;
????M?=?1000;??
????pop?=?100;??
????dim?=?20;??
????G?=?10;???????
????rPercent?=?0.15;?
????hPercent?=?0.7;??
????mPercent?=?0.5;??????????????????
end

rNum?=?round(?pop?*?rPercent?);????%?The?population?size?of?roosters
hNum?=?round(?pop?*?hPercent?);????%?The?population?size?of?hens
cNum?=?pop?-?rNum?-?hNum;??????????%?The?population?size?of?chicks
mNum?=?round(?hNum?*?mPercent?);???%?The?population?size?of?mother?hens

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?correspondi

評論

共有 條評論