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

📄 shareevaniche.sci

📁 基于SCILAB的The Genetic Algorithm Toolbox for SCILAB (GATS)工具箱
💻 SCI
字号:
function endPop=ShareEvaNiche(oldPop,bounds,NicheOpt,options)
// options(1) parameter for caculate distance
// options(2) parameter for share distance
e = size(oldPop,2) ; //number of Variables +fit
n = size(oldPop,1);   //number of Pop;
endPop=oldPop;
dis= zeros(n);
sharew=zeros(n);
sumw=zeros(n,1);
for i=1:n 
    Pop1=oldPop(i,:);
    for j=i+1:n
        Pop2=oldPop(j,:);
        dis(i,j)= normDistance(Pop1,Pop2,bounds,options);
        sharew(i,j) = ShareFunction(dis(i,j),NicheOpt(1) );
    end
end
sumw= (sum(sharew)' + sum(sharew')' - diag(sharew))'+1;
endPop(:,e)=endPop(:,e)./sumw';
end


function shareweight=ShareFunction(distance,sharedistance )
if ( distance <= sharedistance )
    shareweight = 1- distance/sharedistance;
else
    shareweight = 0;
end
end

⌨️ 快捷键说明

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