资源简介
该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免安装版
相关资源
- 2014 Matlab免安装版
- 用MATLAB求解微分方程及微分方程组
- DSSS直接序列扩频通信系统仿真Matlab程
- Multi_frequency_heterodyne_phase_solution.rar
- PSO工具箱
- 遗传优化算法,matlab实现程序,有详
- 粒子群优化算法,matlab实现程序,有
- 精密单点定位的Matlab code
- matlab实现的等间隔量化的HSV颜色特征
- 灰度图像的二维Otsu自动阈值分割法
- 帧内预测matlab程序
- flapping,UVLM,matlab code
- l1-magic工具箱代码
- matlab 数据集 banana
- 放大器模型的matlab仿真实现
- matlab巴特沃斯滤波器m代码
- matlab通信工具箱教程
- matlab2011a种子
- idma 的程序,用matlab实现的idma的系统
- RFID系统MATLAB仿真
- 小游戏贪吃蛇的matlab编程
- CSMA/CA协议matlab代码模拟仿真
- 粒子群算法优化BP神经网络权值的程序
- 用粒子群算法优化支持向量机的matl
- 外点牛顿罚函数优化matlab代码
- S曲线 MATLAB仿真通过
- 用MATLAB编写的高斯脉冲
- matlab实现卷积码编码和解码
- 基四FFT matlab
-
MATLAB PID simuli
nk
评论
共有 条评论