锦标赛选择:
- 锦标赛选择是从个体的群体中选择的个体的方法。
- 锦标赛选择包括在从群体中随机选择的几个人中进行几次“锦标赛”。
- 每个锦标赛的胜者(具有最佳身体素质的)被选为交叉。
- 当锦标赛规模较小时,锦标赛选择也给所有人选择机会,因此它保留了多样性,但保持多样性可能会降低收敛速度。
- 但是,如果锦标赛规模较大,弱个体选择机会较小会导致多样性的丧失。
伪代码:
choose k (the tournament size) individuals from the population at random
choose the best individual from pool/tournament with probability p
choose the second best individual with probability p*(1-p)
choose the third best individual with probability p*((1-p)^2)
and so on...
确定性锦标赛选择选择最佳个体(当p = 1)在任何比赛。单向锦标赛(k = 1)选择相当于随机选择。如果需要,所选择的个体可以从选择的群体中移除,否则个体可以为下一代选择不止一次。与(随机)健身比例选择方法相比,比赛选择通常由于缺乏随机噪声而在实践中实施。
锦标赛选择MatLab中:
Matepool=randi(PopLength,PopLength,2);%%select two individuals randomly for tournament and chooose the one with best fitness value
%% number of tournament is equal to the number of population size
for i=1:PopLength
if Fitness(Matepool(i,1))>= Fitness(Matepool(i,2))
SelectedPop(i,1:IndLength)=CurrentPop(Matepool(i,1),1:IndLength);
else
SelectedPop(i,1:IndLength)=CurrentPop(Matepool(i,2),1:IndLength);
end
end
请相应地格式化你的代码。 http://stackoverflow.com/editing-help – bdhar 2011-02-02 10:22:07
哦,对不起! 看起来像别人已经有了,我会记住下次。 – Reu 2011-02-02 10:25:13