我正在编写一种遗传算法,计划从轮盘赌选择转向锦标赛选择,但我怀疑我的理解可能有误。
如果我只选择种群中前 n/2 个最佳解决方案,那么我很快就会用尽种群?
我的对该算法的理解是:
如果我只选择种群中前 n/2 个最佳解决方案,那么我很快就会用尽种群?
我的对该算法的理解是:
for(Member m in currentPopulation){
Member randomMember1 = random member of currentPopulation which is then removed from currentPopulation
Member randomMember2 = as above;
//Mutate and crossover
if(randomMember1.getScore() > randomMember2.getScore()){
nextGeneration.add(randomMember1);
} else {
nextGeneration.add(randomMember2);
}
}
我理解得对吗?