📄 ga_fdex4coley.m
字号:
% GA_fdex4coley.m file
% Fin max of (x1,x2) of Example 4 on P.30 of Cpley
%**********************************************************/
% User can modify the following in blocks
%**********************************************************/
obj_fcn = 'func_ex4'; % Objective function
range = [-100 -100
100 100]; % Range of the input variables
bit_n = 78; % Bit number for each input variable
generation_n = 332; % Number of generations
popuSize = 58; % Population size
xover_rate = 0.7; % Crossover rate (BETTER)
mutate_rate = 0.04; % Mutation rate (BETTER)
elite=1;
tic
[popu, popu_real, fcn_value, upper, average, lower, popuSize]=GA_genetic(...
obj_fcn, range, [ ], elite, generation_n , ...
popuSize, bit_n, xover_rate, mutate_rate);
t=toc/60;
fprintf('==> Computation time is (%.2f) minutes.\n',t);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -