?? chrom.m
字號(hào):
function c = chrom(varargin)% CHROM - Constructor for the chromosome class% This is the corner stone data type that the genetic tools operate on.% It has four fields that contains all necsessary data. % ____________________% | -------- -------- |% || NAME ||FITNESS ||% | -------- -------- |% | -------- -------- |% || CDVS || DDVS ||% | -------- -------- |% |____________________|%% A chromosome is created by calling the constructor.% c=chrom('name',cdvs,ddvs) or c=chrom % In the first case a chromosome is created with the properties% supplied in the function call. cdvs and ddvs are the continuous-% and discrete design variables repsectively. The 'name' is a% string that identifies a chromosome. This to allow multiple% species in a population. Note that the FITNESS is never set. It% is always initialized to an empty matrix. Calling the% constructor without any arguments creates an "empty" chromosome.% See also CDV,DDV,UI_GEN,UI_CHROM switch nargin case 0 c=struct('name','','cdvs',cdv,'ddvs',ddv,'fitness',[],'id',''); c = class(c,'chrom'); case 1 if isa(varargin{1},'chrom') c=varargin{1}; else error('wrong argument') end case 3 c=struct('name',varargin{1},'cdvs',varargin{2},'ddvs', ... varargin{3},'fitness',[],'id',''); c=class(c,'chrom'); otherwise error('Wrong number of arguments')end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -