本文整理汇总了Python中Population.Population.getBestRate方法的典型用法代码示例。如果您正苦于以下问题:Python Population.getBestRate方法的具体用法?Python Population.getBestRate怎么用?Python Population.getBestRate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Population.Population
的用法示例。
在下文中一共展示了Population.getBestRate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: time
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import getBestRate [as 别名]
if best_chromosome == False or temp.rate > best_chromosome.rate:
best_chromosome_population = p.population_number
best_chromosome = temp
if settings['max_populations_amount'] >= 0 and \
p.population_number > settings['max_populations_amount']:
break
if settings['max_chromosome_length'] >= 0 and \
p.chromosome_length > settings['max_chromosome_length']:
break
t1 = time()
if settings['max_time'] >= 0 and t1 - t0 > settings['max_time']:
break
if p.getBestRate() == settings['target_rate']:
break
if p.population_number % settings['step'] == 0:
p.extendChromosomes(settings['extend'])
p.chromosome_length += settings['extend']
p.modify()
print "Czas obliczen: ",int(t1-t0),"s (",int((t1-t0)*1000),"ms)"
print "Najlepszy chromosom:",best_chromosome.moves
print "Ocena:",best_chromosome.rate
print "Wystapil w",best_chromosome_population,"populacji"
print "Wygenerowanych populacji lacznie:",p.population_number