📄 ga_initpopu.m
字号:
function popu=GA_initpopu(popuSize, bit_n, var_n, PRINT)
% popuSize is the size of population, an even positive
% integer is prefered. i.e. popuSize=36.
% bit_n is the bit length.
% var_n is the number of parameters(Genes)
% PRINT=1 then print out Binary Population Chromosomes
% For example:
% GA_initpopu(36, 8, 2)
% PenChen Chou, 6-30-2001
if nargin==3
popu = rand(popuSize, bit_n*var_n) > 0.5;
else
popu = rand(popuSize, bit_n*var_n) > 0.5
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -