-
大小: 3KB文件類型: .m金幣: 1下載: 0 次發布日期: 2021-06-03
- 語言: Matlab
- 標簽:
資源簡介
matlab源程序代碼\遺傳算法工具箱\genetic\bs2rv.m\遺傳算法工具箱\genetic\bs2rv.m\遺傳算法工具箱\genetic\bs2rv.m
代碼片段和文件信息
%?BS2RV.m?-?Binary?string?to?real?vector
%
%?This?function?decodes?binary?chromosomes?into?vectors?of?reals.?The
%?chromosomes?are?seen?as?the?concatenation?of?binary?strings?of?given
%?length?and?decoded?into?real?numbers?in?a?specified?interval?using
%?either?standard?binary?or?Gray?decoding.
%
%?Syntax:???????Phen?=?bs2rv(ChromFieldD)
%
%?Input?parameters:
%
%???????????????Chrom????-?Matrix?containing?the?chromosomes?of?the?current
%??????????????????????????population.?Each?line?corresponds?to?one
%??????????????????????????individual‘s?concatenated?binary?string
%??????????? ???representation.?Leftmost?bits?are?MSb?and
% ???????????????rightmost?are?LSb.
%
%???????????????FieldD???-?Matrix?describing?the?length?and?how?to?decode
%??????????? ???each?substring?in?the?chromosome.?It?has?the
%??????????? ???following?structure:
%
% [len; (num)
% ?lb; (num)
% ?ub; (num)
% ?code; (0=binary?????|?1=gray)
% ?scale; (0=arithmetic?|?1=logarithmic)
% ?lbin; (0=excluded???|?1=included)
% ?ubin]; (0=excluded???|?1=included)
%
% ???where
% len???-?row?vector?containing?the?length?of
%??? each?substring?in?Chrom.?sum(len)
% ???? should?equal?the?individual?length.
% lb
% ub????-?Lower?and?upper?bounds?for?each
% ???? variable.?
% code??-?binary?row?vector?indicating?how?each
% ???? substring?is?to?be?decoded.
% scale?-?binary?row?vector?indicating?where?to
% ???? use?arithmetic?and/or?logarithmic
% ???? scaling.
% lbin
% ubin??-?binary?row?vectors?indicating?whether
% ???? or?not?to?include?each?bound?in?the
% ???? representatio
評論
共有 條評論