我有一个遗传算法,目前正在使用轮盘赌轮选择产生一个新的人口,我想改变它随机通用抽样。在
我对这里的工作有一个粗略的概述:
pointerDistance = sumFitness/popSize
start = rand.uniform(0, pointerDistance)
for i in xrange(popSize):
pointers.append(start + i*pointerDistance)
cumulativeFit = 0
newIndiv = 0
for p in pointers:
while cumulativeFit <= p:
cumulativeFit += pop[newIndiv].fitness
newPop[newIndiv] = copy.deepcopy(pop[newIndiv])
newIndiv += 1
但我在努力到底如何实现随机通用抽样。有没有人知道一些伪代码的好来源,或者一个例子?在
用一个例子简要说明什么是随机通用抽样(但我不确定它是否有意义?)公司名称:
相关问题 更多 >
编程相关推荐