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

  • 大小: 2KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-08
  • 語言: 其他
  • 標簽: GA??

資源簡介

對于遺傳算法中的初始種群的產生過程進行了詳盡的解釋,對于大家對遺傳算法的理解十分有用!

資源截圖

代碼片段和文件信息

function?[pop]?=?initializega(num?bounds?evalFNevalOpsoptions)?%有5個輸入項,1個輸出項
%?function?[pop]=initializega(populationSize?variableBoundsevalFN
%???????????????????????????evalOpsoptions)
%????initializega?creates?a?matrix?of?random?numbers?with?
%????a?number?of?rows?equal?to?the?populationSize?and?a?number
%????columns?equal?to?the?number?of?rows?in?bounds?plus?1?for
%????the?f(x)?value?which?is?found?by?applying?the?evalFN.
%????This?is?used?by?the?ga?to?create?the?population?if?it
%????is?not?supplied.
%
%?pop????????????-?the?initial?evaluated?random?population?
%?populatoinSize?-?the?size?of?the?population?i.e.?the?number?to?create
%?variableBounds?-?a?matrix?which?contains?the?bounds?of?each?variable?i.e.
%??????????????????[var1_high?var1_low;?var2_high?var2_low;?....]
%?evalFN?????????-?the?evaluation?fn?usually?the?name?of?the?.m?file?for?
%??????????????????evaluation
%?evalOps????????-?any?options?to?be?passed?to?the?eval?function?defaults?[]
%?options????????-?options?to?the?initialize?function?ie.?
%??????????????????[type?prec]?where?eps?is?the?epsilon?value?
%??????????????????and?the?second?option?is?1?for?float?and?0?for?binary?
%??????????????????prec?is?the?precision?of?the?variables?defaults?[1e-6?1]

%?Binary?and?Real-Valued?Simulation?Evolution?for?Matlab?GAOT?V2?
%?Copyright?(C)?1998?C.R.?Houck?J.A.?Joines?M.G.?Kay?
%
%?C.R.?Houck?J.Joines?and?M.Kay.?A?genetic?algorithm?for?function
%?optimization:?A?Matlab?implementation.?ACM?Transactions?on?Mathmatical
%?Software?Submitted?1996.
%
%?This?program?is?free?software;?you?can?redistribute?it?and/or?modify
%?it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
%?the?Free?Software?Foundation;?either?version?1?or?(at?your?option)
%?any?later?version.
%
%?This?program?is?distributed?in?the?hope?that?it?will?be?useful
%?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
%?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
%?GNU?General?Public?License?for?more?details.?A?copy?of?the?GNU?
%?General?Public?License?can?be?obtained?from?the?
%?Free?Software?Foundation?Inc.?675?Mass?Ave?Cambridge?MA?02139?USA.

if?nargin<5??%nargin:是用來判斷輸入項個數的函數
??options=[1e-6?1];?%如果初始化函數的輸入項個數小于5,則參數結構體options=[1e-6?1]
end
if?nargin<4?%如果初始化函數的輸入項個數小于4,則傳遞給適應度函數的參數evalOps=[]
??evalOps=[];?????
end

if?any(evalFN<48)?%Not?a?.m?file?意思是說如果evalFN不是一個M文件
??if?options(2)==1?%Float?GA
????estr=[‘x=pop(i1);?pop(ixZomeLength)=‘?evalFN?‘;‘];??
??else?%Binary?GA
????estr=[‘x=b2f(pop(i:)boundsbits);?pop(ixZomeLength)=‘?evalFN?‘;‘];?
??end
else?%A?.m?file?如果是M文件
????if?options(2)==1?%Float?GA?如果options的第二列為1,則采用實數編碼
????????estr=[‘[?pop(i:)?pop(ixZomeLength)]=‘?evalFN?‘(pop(i:)[0?evalOps]);‘];?%實際上就是和適應度函數銜接了。‘[?pop(i:)?pop(ixZomeLength)]=‘?evalFN?‘(pop(i:)[0?evalOps]);‘的格式和適應度函數的定義的格式是一摸一樣。
????else?%Binary?GA?如果參數結構體的第二列為0,則采用二進制編碼
????????estr=[‘x=b2f(pop(i:)boundsbits);[x?v]=‘?evalFN?...
????????????‘(x[0?evalOps]);?pop(i:)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????4299??2009-05-06?07:49??initializega.m

-----------?---------??----------?-----??----

?????????????????4299????????????????????1


評論

共有 條評論