⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gaplotselection.m

📁 遗传算法工具包
💻 M
字号:
function state = gaplotselection(options,state,flag)
%GAPLOTSELECTION A histogram of parents.
%   STATE = GAPLOTSELECTION(OPTIONS,STATE,FLAG) plots a histogram of the
%   parents. This will let you see which parents are contributing to each 
%   generation. If there is not enough spread (only a few parents are being 
%   used) then you may want to change some parameters to get more diversity.
%
%   Example:
%    Create an options structure that uses GAPLOTSELECTION
%    as the plot function
%      options = gaoptimset('PlotFcns',@gaplotselection);

%   Copyright 2004 The MathWorks, Inc. 
%   $Revision: 1.7.4.1 $  $Date: 2004/04/04 03:24:31 $

if(strcmp(flag,'iter'))
    hist(state.Selection);
    name = func2str(options.SelectionFcn);
    title([name,' Selection'])
    xlabel('Individual')
    ylabel('Number of children')
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -