资源简介
matlab遗传算法工具箱gatbx(直接可用版)
代码片段和文件信息
% 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\bs2rv.m
文件 222 2017-08-27 09:26 gatbx\change.bat
文件 1835 1998-04-22 10:44 gatbx\contents.m
文件 1168 1998-04-22 10:44 gatbx\crtba
文件 2187 1998-04-22 10:44 gatbx\crtbp.m
文件 2090 2008-11-14 16:35 gatbx\crtrp.m
文件 12501 2005-11-28 15:21 gatbx\DOC\ga toolbox frequently asked questions.txt
文件 16715 2005-12-02 09:07 gatbx\DOC\gatbxa0.pdf
文件 53484 1998-04-22 11:14 gatbx\DOC\gatbxa0.ps
文件 109101 2005-12-02 09:10 gatbx\DOC\gatbxa1.pdf
文件 204230 1998-04-22 11:14 gatbx\DOC\gatbxa1.ps
文件 101958 2005-12-02 09:16 gatbx\DOC\gatbxa2.pdf
文件 200234 1998-04-22 11:14 gatbx\DOC\gatbxa2.ps
文件 18351 2005-11-28 15:25 gatbx\DOC\gpl.txt
文件 1525 2005-11-28 15:25 gatbx\DOC\readme.txt
文件 98687 2005-11-28 16:18 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\migrate.m
文件 4019 1998-04-22 10:44 gatbx\mpga.m
文件 1609 1998-04-22 10:44 gatbx\mut.m
文件 3437 1998-04-22 10:44 gatbx\mutate.m
文件 4943 1998-04-22 10:44 gatbx\mutbga.m
文件 2642 2017-08-30 01:37 gatbx\objfun1.m
文件 2559 1998-04-22 10:44 gatbx\objharv.m
文件 4709 1998-04-22 10:44 gatbx\ranking.m
文件 1825 1998-04-22 10:44 gatbx\recdis.m
文件 1895 1998-04-22 10:44 gatbx\recint.m
文件 1953 1998-04-22 10:44 gatbx\reclin.m
文件 4852 1998-04-22 10:44 gatbx\recmut.m
文件 2438 1998-04-22 10:44 gatbx\recombin.m
文件 5574 1998-04-22 10:44 gatbx\reins.m
............此处省略49个文件信息
- 上一篇:包括多机器人避障算法.rar
- 下一篇:生物地理学优化BBO的matlab实现
相关资源
- 运用遗传算法求解带出入点的车间布
- matlab基于遗传算法实现的高效排课系
- 遗传算法解决最短路径问题matlab程序
- 遗传算法matlab源代码
- 免疫遗传算法
- 遗传算法求函数f=x+10*sin(5*x)+7*cos(
- 遗传算法及其改进算法的matlab程序
- 遗传算法和粒子群算法结合的matlab源
- 遗传算法的无功优化matlab实现
- 遗传算法求解多元函数最值源程序
- 基于非支配排序遗传算法处理多目标
- 基于Matlab工具的遗传算法求解有约束
- 量子遗传算法求函数最优值
- 基本的遗传算法MATLAB实现
- 遗传算法 实现动力配煤+gui界面 matl
- 遗传算法解决非线性规划问题的Matl
- 基于遗传算法的柔性车间调度.rar
- 遗传算法 MATLAB程序合集
- 遗传算法贪心交叉
- 遗传算法完整MATLAB程序实数法,覆盖
- Matlab遗传算法源程序详解
- 使用遗传算法优化BP神经网络权值 的
- 基于多层编码遗传算法的车间调度算
- MATLAB GA工具箱
- 遗传算法优化BPNN车位预测
- 遗传算法优化小波函数车位预测
- 遗传算法改进的模糊C-均值聚类MATLA
- 遗传算法小波神经网络
- 遗传算法Demo
- 遗传算法解决VRP源程序
评论
共有 条评论