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

📄 clusterselniche.sci

📁 基于SCILAB的The Genetic Algorithm Toolbox for SCILAB (GATS)工具箱
💻 SCI
字号:
function endPop=ClusterSelNiche(oldPop,newPop,bounds,NicheOpt,options)
e = size(oldPop,2)-1; //number of Variables
n = size(oldPop,1);   //number of Pop;
CF=NicheOpt(1);  //parameter for select
endPop=oldPop;
[a,randidx]=gsort(rand(n,CF)*n,'g','i');
initIndex=zeros(n,1);
for i=1:n 
    Pop1=newPop(i,:);
    initDistance = 1; //maxmiam distance between two population
    for j=1:CF 
        Pop2=oldPop(randidx(i,j),:);
        dis= normDistance(Pop1,Pop2,bounds,options);
        if (dis < initDistance)
            initDistance = dis;
            initIndex(i) = j;
        end
    end
    endPop(randidx(i,initIndex(i)),:)=Pop1;
end







    

⌨️ 快捷键说明

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