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

📄 normal.m

📁 The Source of Genetic Programming developed in Matlab
💻 M
字号:
function accept=normal(currentmean,state,params)
%NORMAL    Decides whether to accept a GPLAB individual into the population.
%   NORMAL(MEAN,STATE,PARAMS) returns true (acceptance) if the acceptance
%   of the individual improves the best average fitness obtained so far.
%   Returns false otherwise. It is not so easy to accept individuals under
%   these conditions, so the name is NORMAL (compare with light.m).
%   
%   Input arguments:
%      MEAN - average fitness obtained by accepting the individual (double)
%      STATE - the current state of the algorithm (struct)
%      PARAMS - the parameters of the algorithm (struct)
%   Output arguments:
%      ACCEPT - true if individual is accepted, false otherwise (boolean)
%
%   See also RESOURCES, LIGHT
%
%   Copyright (C) 2003-2007 Sara Silva (sara@dei.uc.pt)
%   This file is part of the GPLAB Toolbox

if ((currentmean<state.bestavgfitnesssofar) && (params.lowerisbetter)) || ((currentmean>state.bestavgfitnesssofar) && (~params.lowerisbetter))
    accept=1;
else
    accept=0;
end

⌨️ 快捷键说明

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