?? gaplotchange.m
字號:
function state = gaplotchange(options, state, flag)
% GAPLOTCHANGE Plots the logarithmic change in the best score from the
% previous generation.繪圖函數gaplotchange畫出前一代個體最佳值變化的圖形
%
persistent last_best % Best score in the previous generation 前一代個體的最佳值
if(strcmp(flag,'init')) % Set up the plot 開始繪圖
set(gca,'xlim',[1,options.Generations],'Yscale','log');
hold on;
xlabel Generation
title('Change in Best Fitness Value')
end
best = min(state.Score); % Best score in the current generation 當前代個體的最佳值
if state.Generation == 0 % Set last_best to best. 設置last_best為最佳
last_best = best;
else
change = last_best - best; % Change in best score 個體最佳值的改變
last_best=best;
plot(state.Generation, change, '.r');
title(['Change in Best Fitness Value'])
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -