?? light.m
字號:
function accept=light(currentmean,state,params)
%LIGHT Decides whether to accept a GPLAB individual into the population.
% LIGHT(MEAN,STATE,PARAMS) returns true (acceptance) if the acceptance
% of the individual improves the average fitness of the population when
% compared to the population without the individual. Returns false
% otherwise. It is easy to accept individuals under these conditions,
% so the name is LIGHT (compare with normal.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, NORMAL
%
% Copyright (C) 2003-2007 Sara Silva (sara@dei.uc.pt)
% This file is part of the GPLAB Toolbox
if ((currentmean<state.avgfitness) && (params.lowerisbetter)) || ((currentmean>state.avgfitness) && (~params.lowerisbetter))
accept=1;
else
accept=0;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -