资源简介
该geneticbx为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
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 geneticbx\bs2rv.m
文件 222 2017-08-27 09:26 geneticbx\change.bat
文件 1835 1998-04-22 10:44 geneticbx\contents.m
文件 1168 1998-04-22 10:44 geneticbx\crtba
文件 2187 1998-04-22 10:44 geneticbx\crtbp.m
文件 2090 2008-11-14 16:35 geneticbx\crtrp.m
文件 12501 2005-11-28 15:21 geneticbx\DOC\ga toolbox frequently asked questions.txt
文件 16715 2005-12-02 09:07 geneticbx\DOC\gatbxa0.pdf
文件 53484 1998-04-22 11:14 geneticbx\DOC\gatbxa0.ps
文件 109101 2005-12-02 09:10 geneticbx\DOC\gatbxa1.pdf
文件 204230 1998-04-22 11:14 geneticbx\DOC\gatbxa1.ps
文件 101958 2005-12-02 09:16 geneticbx\DOC\gatbxa2.pdf
文件 200234 1998-04-22 11:14 geneticbx\DOC\gatbxa2.ps
文件 18351 2005-11-28 15:25 geneticbx\DOC\gpl.txt
文件 1525 2005-11-28 15:25 geneticbx\DOC\readme.txt
文件 98687 2005-11-28 16:18 geneticbx\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
文件 13731 2018-05-27 10:14 geneticbx\geneticbx使用方法.docx
文件 7205 1998-04-22 10:44 geneticbx\migrate.m
文件 4019 1998-04-22 10:44 geneticbx\mpga.m
文件 1609 1998-04-22 10:44 geneticbx\mut.m
文件 3437 1998-04-22 10:44 geneticbx\mutate.m
文件 4943 1998-04-22 10:44 geneticbx\mutbga.m
文件 2642 2017-08-30 01:37 geneticbx\objfun1.m
文件 2559 1998-04-22 10:44 geneticbx\objharv.m
文件 4709 1998-04-22 10:44 geneticbx\ranking.m
文件 1825 1998-04-22 10:44 geneticbx\recdis.m
文件 1895 1998-04-22 10:44 geneticbx\recint.m
文件 1953 1998-04-22 10:44 geneticbx\reclin.m
文件 4852 1998-04-22 10:44 geneticbx\recmut.m
文件 2438 1998-04-22 10:44 geneticbx\recombin.m
............此处省略49个文件信息
- 上一篇:用MATLAB求解微分方程及微分方程组
- 下一篇:2014 Matlab免安装版
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
评论
共有 条评论