是否可以使用适应度值来评估种群中的每个个体,而无需找到概率,如下面的伪代码
For all members of population
sum += fitness ( member)
End for
Loop until new population is full
Do this twice
Number = Random between 0 and sum
Currentfitness = 0.0
For each member in population
Currentfitness += fitness (member)
if Number > Currentfitness then select member
End for
End
Create offspring
End loop
以及代码的以下部分做什么?
Do this twice
我真的很困惑轮盘赌如何选择一对父母。有什么帮助吗?提前致谢