?? ga_print.m
字號:
function GA_print(gen_no, gen_last, var_n, popu, ...
popu_real, fcn_val, STEPS)
global LOCUS x_data y_data
%=====================================================
% GA_print.m
% function GA_print(gen_no, gen_last, var_n, popu, ...
% popu_real, fcn_val, STEPS)
% global LOCUS x_data y_data
%=====================================================
% Print intermediate results like the following
% [Generation #500], ===>Best_FIT= 51.00000000
% parameter( 1)= -5.01609163
% parameter( 2)= -5.06722401
% parameter( 3)= -5.11193552
% parameter( 4)= -5.01528481
% parameter( 5)= -5.02855515
%
% If LOCUS is not zero, collect parameter(1) to
% x_data and parameter(2) to y_data for plotting
% Only for the 3-dim plot
% LOCUS, x_data, y_data must be defined in MAIN program
% PenChen Chou, 7-1-2001
% Make sure to get the best of fitness function
[Y, I]=max(fcn_val);
%
BEST=popu_real(I,:);
BEST_bit=popu(I,:);
BEST_fit =Y;
if mod(gen_no,STEPS)==0 | gen_no==1 | gen_no==gen_last
fprintf('\n[Generation #%i], ===>Best_FIT= %.8f\n',...
gen_no, Y);
for I=1:var_n
fprintf(' parameter(%2i)=%13.8f\n',...
I, BEST(I));
end;
else
fprintf('\n');
end;
% If LOCUS is not zero, plot the best parameters on 3-dim
% contour in figure 2. So, collect the data first.
if LOCUS>0
x_data=[x_data BEST(1)];
y_data=[y_data BEST(2)];
end;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -