资源简介
matlab遗传算法工具箱gatbx,亲测好用,具体使用方法参考雷英杰《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
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:Nvar
idx = li(i):lf(i);
if code(i) % Gray decoding
Chrom(:idx)=rem(cumsum(Chrom(:idx)‘)‘2);
end
Phen(:i) = Chrom(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3217 1998-04-22 10:44 gatbx\gatbx\bs2rv.m
文件 222 2017-08-27 09:26 gatbx\gatbx\change.bat
文件 1835 1998-04-22 10:44 gatbx\gatbx\contents.m
文件 1168 1998-04-22 10:44 gatbx\gatbx\crtba
文件 2187 1998-04-22 10:44 gatbx\gatbx\crtbp.m
文件 2090 2008-11-14 16:35 gatbx\gatbx\crtrp.m
文件 12501 2005-11-28 15:21 gatbx\gatbx\DOC\ga toolbox frequently asked questions.txt
文件 16715 2005-12-02 09:07 gatbx\gatbx\DOC\gatbxa0.pdf
文件 53484 1998-04-22 11:14 gatbx\gatbx\DOC\gatbxa0.ps
文件 109101 2005-12-02 09:10 gatbx\gatbx\DOC\gatbxa1.pdf
文件 204230 1998-04-22 11:14 gatbx\gatbx\DOC\gatbxa1.ps
文件 101958 2005-12-02 09:16 gatbx\gatbx\DOC\gatbxa2.pdf
文件 200234 1998-04-22 11:14 gatbx\gatbx\DOC\gatbxa2.ps
文件 18351 2005-11-28 15:25 gatbx\gatbx\DOC\gpl.txt
文件 1525 2005-11-28 15:25 gatbx\gatbx\DOC\readme.txt
文件 98687 2005-11-28 16:18 gatbx\gatbx\DOC\the mathworks - 1-18gtu why do i get an error in matlab 6_0 (r12) where i got a warning in r11 with reference to uninitialized variables.mht
文件 7205 1998-04-22 10:44 gatbx\gatbx\migrate.m
文件 4019 1998-04-22 10:44 gatbx\gatbx\mpga.m
文件 1609 1998-04-22 10:44 gatbx\gatbx\mut.m
文件 3437 1998-04-22 10:44 gatbx\gatbx\mutate.m
文件 4943 1998-04-22 10:44 gatbx\gatbx\mutbga.m
文件 2642 2017-08-30 01:37 gatbx\gatbx\objfun1.m
文件 2559 1998-04-22 10:44 gatbx\gatbx\objharv.m
文件 4709 1998-04-22 10:44 gatbx\gatbx\ranking.m
文件 1825 1998-04-22 10:44 gatbx\gatbx\recdis.m
文件 1895 1998-04-22 10:44 gatbx\gatbx\recint.m
文件 1953 1998-04-22 10:44 gatbx\gatbx\reclin.m
文件 4852 1998-04-22 10:44 gatbx\gatbx\recmut.m
文件 2438 1998-04-22 10:44 gatbx\gatbx\recombin.m
文件 5574 1998-04-22 10:44 gatbx\gatbx\reins.m
............此处省略51个文件信息
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论