documentation for the eaSimple algorithm表示父母被分成成对的连续个体,每对个体产生两个后代
First, the parental population Pp is duplicated using the toolbox.clone() method and the result is put into the offspring population Po. A first loop over Po is executed to mate pairs of consecutive individuals. According to the crossover probability cxpb, the individuals xi and xi+1 are mated using the toolbox.mate() method. The resulting children yi and yi+1 replace their respective parents in Po.
如何处理奇数个体群体中的最后一个个体?它是否从未与其他个体交配,只是发生了变异
从the code来看,在人群中存在一个循环,该循环将个体配对以在
varAnd
中进行交叉:这意味着,如果有奇数个个体,一个个体将永远不会交配
突变的循环是
所以每个人都会变异
结论:事实上,具有奇数个个体的群体中的最后一个个体可能发生突变,但永远不会用于交叉
相关问题 更多 >
编程相关推荐