ga_ex22a.m
来自「其中提到遺傳學的程式碼與應用提供給次淚相向的研究者參考下載」· M 代码 · 共 28 行
M
28 行
% GA_ex22A.m file
% Fin max of x^2 between 0 to 4096
% PenChen Chou, 7-1-2001
%**********************************************************/
% User can modify the following in blocks
%**********************************************************/
global MIN_offset MUL_factor LOCUS x_data y_data
MIN_offset=0; LOCUS=0; x_data=[]; y_data=[];
MUL_factor=1;
obj_fcn = 'GA_f22a'; % Objective function
range = [0
4096]; % Range of the input variables
IC=[];elite=1;
%************************************************************
% calling GA
tic
%function [popu, popu_real, fcn_value, upper, average,...
% lower, popuSize, gen_no]=GA_genetic(obj_fcn, range, IC, elite,...
% gen_no, popuSize, bit_n, xover_rate, mutate_rate);
[popu, popu_real, fcn_value, upper, average, lower, ...
popuSize, gen_no] = GA_genetic(obj_fcn, range,...
IC, elite);
t=toc/60;
fprintf('==> Computation time is (%.2f) minutes.\n',t);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?