📄 ga_fackley.m
字号:
function PI=GA_fAckley(chro)
% function PI=GA_fAckley(chro)
% Fitness function evaluation of Ackey function
% chro is the input argument and is a vector of 2 elements
% MIN_offset, MUL_factor should be declared and values assigned
% before calling this function, such as
% MIN_offset=100; MUL_factor=1;
% in the other program. However, if you want to use function
% alone,(both of the above varaibles are not declared
% before), this program will give you DEFAULT values as
% MIN_offset=25; MUL_factor=1; %<== DEFAULT
% CALLING example:
% PI=GA_fAckley([1.3 4.5])
% PenChen Chou, 8-10-2001
% Revised on 4-10-2002
global MIN_offset MUL_factor
if isempty(MIN_offset)
MIN_offset=25;
end
if isempty(MUL_factor)
MUL_factor=1;
end
x=chro(1); y=chro(2);
PI=-20*exp(-0.2*sqrt(0.5*(x.*x+y.*y)))-exp(0.5*(cos(2*pi*x)+...
cos(2*pi*y)))+20+2.71282;
attached_part;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -