The Algorithms logo
算法
关于我们捐赠

轮盘赌选择

function i = RouletteWheelSelection(p)
    r= rand*sum(p);
    c=cumsum(p);
    i=find(r<=c,1,'first');
end