資源簡介
英國謝菲爾德大學開發的遺傳算法matlab工具箱,最新更新版本,rep等代碼文件擴展均已修改,兼容性好,全面覆蓋其他版本matlab遺傳算法工具箱,請放心下載。下載后直接解壓,進入matlab頁面配置路徑安裝即可,運行流暢無錯誤。

代碼片段和文件信息
%?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
% ???? representation?range
%
%?Output?parameter:
%
%???????????????Phen?????-?Real?matrix?containing?the?population?phenotypes.
%
%?Author:?Carlos?Fonseca? Updated:?Andrew?Chipperfield???
%?Date:?08/06/93 ????Date:?26-Jan-94
%
%?Tested?under?MATLAB?v6?by?Alex?Shenfield?(17-Jan-03)
function?Phen?=?bs2rv(ChromFieldD)
%?Identify?the?population?size?(Nind)
%??????and?the?chromosome?length?(Lind)
[NindLind]?=?size(Chrom);
%?Identify?the?number?of?decision?variables?(Nvar)
[sevenNvar]?=?size(FieldD);
if?seven?~=?7
error(‘FieldD?must?have?7?rows.‘);
end
%?Get?substring?properties
len?=?FieldD(1:);
lb?=?FieldD(2:);
ub?=?FieldD(3:);
code?=?~(~FieldD(4:));
scale?=?~(~FieldD(5:));
lin?=?~(~FieldD(6:));
uin?=?~(~FieldD(7:));
%?Check?substring?properties?for?consistency
if?sum(len)?~=?Lind
error(‘Data?in?FieldD?must?agree?with?chromosome?length‘);
end
if?~all(lb(scale).*ub(scale)>0)
error(‘Log-scaled?variables?must?not?include?0?in?their?range‘);
end
%?Decode?chromosomes
Phen?=?zeros(NindNvar);
lf?=?cumsum(len);
li?=?cumsum([1?len]);
Prec?=?.5?.^?len;
logsgn?=?sign(lb(scale));
lb(scale)?=?log(?abs(lb(scale))?);
ub(scale)?=?log(?abs(ub(scale))?);
delta?=?ub?-?lb;
Prec?=?.5?.^?len;
num?=?(~lin)?.*?Prec;
den?=?(lin?+?uin?-?1)?.*?Prec;
for?i?=?1:Nv
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-12-23?11:45??謝菲爾德遺傳工具箱\
?????目錄???????????0??2016-12-23?11:45??謝菲爾德遺傳工具箱\genetic\
?????文件????????3356??2003-01-26?16:34??謝菲爾德遺傳工具箱\genetic\bs2rv.m
?????文件????????1833??2003-01-24?16:59??謝菲爾德遺傳工具箱\genetic\contents.m
?????文件????????1238??2003-01-26?16:35??謝菲爾德遺傳工具箱\genetic\crtba
?????文件????????2270??2003-01-26?16:36??謝菲爾德遺傳工具箱\genetic\crtbp.m
?????文件????????2156??2003-01-26?16:37??謝菲爾德遺傳工具箱\genetic\crtrp.m
?????目錄???????????0??2016-12-23?11:45??謝菲爾德遺傳工具箱\genetic\DOC\
?????文件???????53484??1998-04-22?11:14??謝菲爾德遺傳工具箱\genetic\DOC\GATBXA0.PS
?????文件??????204230??1998-04-22?11:14??謝菲爾德遺傳工具箱\genetic\DOC\GATBXA1.PS
?????文件??????200234??1998-04-22?11:14??謝菲爾德遺傳工具箱\genetic\DOC\GATBXA2.PS
?????文件???????18349??2003-07-18?10:58??謝菲爾德遺傳工具箱\genetic\gpl.txt
?????文件????????7272??2003-01-26?16:38??謝菲爾德遺傳工具箱\genetic\migrate.m
?????文件????????4074??2003-01-26?16:38??謝菲爾德遺傳工具箱\genetic\mpga.m
?????文件????????1663??2003-01-26?16:39??謝菲爾德遺傳工具箱\genetic\mut.m
?????文件????????3503??2003-01-26?16:40??謝菲爾德遺傳工具箱\genetic\mutate.m
?????文件????????5008??2003-01-26?16:40??謝菲爾德遺傳工具箱\genetic\mutbga.m
?????文件????????2717??2003-01-21?12:30??謝菲爾德遺傳工具箱\genetic\objfun1.m
?????文件????????2643??2003-01-21?12:32??謝菲爾德遺傳工具箱\genetic\objharv.m
?????文件????????4822??2003-01-26?15:18??謝菲爾德遺傳工具箱\genetic\ranking.m
?????文件????????1890??2003-01-26?16:42??謝菲爾德遺傳工具箱\genetic\recdis.m
?????文件????????1958??2003-01-26?16:42??謝菲爾德遺傳工具箱\genetic\recint.m
?????文件????????2018??2003-01-26?16:43??謝菲爾德遺傳工具箱\genetic\reclin.m
?????文件????????4996??2003-01-26?16:21??謝菲爾德遺傳工具箱\genetic\recmut.m
?????文件????????2569??2003-01-26?16:23??謝菲爾德遺傳工具箱\genetic\recombin.m
?????文件????????5638??2003-01-26?16:44??謝菲爾德遺傳工具箱\genetic\reins.m
?????文件????????1272??2003-01-26?16:45??謝菲爾德遺傳工具箱\genetic\rep.m
?????文件????????2145??2003-01-22?11:56??謝菲爾德遺傳工具箱\genetic\resplot.m
?????文件????????1166??2003-01-26?16:45??謝菲爾德遺傳工具箱\genetic\rws.m
?????文件????????1255??2003-01-26?16:46??謝菲爾德遺傳工具箱\genetic\scaling.m
?????文件????????2466??2003-01-26?16:46??謝菲爾德遺傳工具箱\genetic\select.m
............此處省略37個文件信息
評論
共有 條評論