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

📄 roulette.m

📁 Real Genetic Algorithm RGA
💻 M
字号:

% -------------------- Roulette Wheel Function ----------------------

function[Selected_gen]=Roulette(N,Selection_rate,Population)

temp2(1)=Selection_rate(1);
for i=2:N
    temp2(i)=temp2(i-1)+Selection_rate(i);
end
for i=1:N
    ran3=rand;
    for j=1:N
        if ran3<=temp2(j)
            Selected_gen(i,:)=Population(j,:);
            break
        end
    end
end
  

⌨️ 快捷键说明

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