normdistance.sci
来自「基于SCILAB的The Genetic Algorithm Toolbox f」· SCI 代码 · 共 13 行
SCI
13 行
function [distance] = normDistance(Pop1,Pop2,bounds,options)
if ( options(1)==1 ) // Float ga
n=size(Pop1,2) -1; // Variables' number
ndis=((Pop1(1:n) - Pop2(1:n))'./(bounds(:,1) - bounds(:,2))).^2;
distance = sqrt(sum(ndis)/n);
else
n=size(Pop1,2) -1 ; // Variables' number
distance=(sum(abs(Pop1(1:n) - Pop2(1:n)))/n);
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?