-
大小: 2KB文件类型: .m金币: 1下载: 0 次发布日期: 2021-06-03
- 语言: Matlab
- 标签:
资源简介
(matlab源程序代码)遗传算法工具箱\genetic\crtbp.m遗传算法工具箱\genetic\crtbp.m
代码片段和文件信息
% CRTBP.m - Create an initial population
%
% This function creates a binary population of given size and structure.
%
% Syntax: [Chrom Lind baseV] = crtbp(Nind Lind base)
%
% Input Parameters:
%
% Nind - Either a scalar containing the number of individuals
% in the new population or a row vector of length two
% containing the number of individuals and their length.
%
% Lind - A scalar containing the length of the individual
% chromosomes.
%
% base - A scalar containing the base of the chromosome
% elements or a row vector containing the base(s)
% of the loci of the chromosomes.
%
% Output Parameters:
%
% Chrom - A matrix containing the random valued chromosomes
% row wise.
%
% Lind - A scalar containing the length of the chromosome.
%
% baseV - A row vector containing the base of the
% chromosome loci.
%
% Author: Andrew Chipperfield
% Date: 19-Jan-94
%
% Tested under MATLAB v6 by Alex Shenfield (20-Jan-03)
function [Chrom Lind baseV] = crtbp(Nind Lind base)
nargs = nargin ;
% Check parameter consistency
if n
评论
共有 条评论