ga_fextra2.m
来自「其中提到遺傳學的程式碼與應用提供給次淚相向的研究者參考下載」· M 代码 · 共 23 行
M
23 行
function PI=GA_fextra2(x)
% Fitness function evaluation
% chro is the array transfered from GA for optimization.
% PenChen Chou, 2003-11-12
global MIN_offset MUL_factor
% Always to set MAX_factor=1, if you have no idea about
% the meaning of MAX_factor at the first time.
if exist('MUL_factor','var'),
if isempty(MUL_factor), MUL_factor=1; end
end
% Fitness function evaluation
y=100-x;
PI=x*y;
if (x-y)<5, PI=PI-100; end;
% attached_part is used to transfer a minimization problem
% into a maximization problem. Input is PI, Output is PI.
attached_part;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?