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

📄 ga_linrank.m

📁 其中提到遺傳學的程式碼與應用提供給次淚相向的研究者參考下載
💻 M
字号:
function fitness=GA_LinRank(object, select_pressure)
%% function fitness=GA_LinRank(object, select_pressure)
%% Change objective function values to fitness function ones

% PenChen Chou.  2002-10-25
% Initiallzations
Nind=length(object);
% SP is at most to be 2.
SP=max([0, min([2,select_pressure])]);

% Sort into right position, take the index.
[temp, inx]=sort(object);

% Linear ranking with select_pressure.
% The last position gets the best fitness
for pos=1:Nind
    fitness(pos)=2-SP+2*(SP-1)*(pos-1)/(Nind-1);
end

% Set the fitness back to the right position.
fitness=[fitness(inx)]';
%------------  END ------------------------------------

⌨️ 快捷键说明

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