本文整理汇总了Python中logger.Log.save方法的典型用法代码示例。如果您正苦于以下问题:Python Log.save方法的具体用法?Python Log.save怎么用?Python Log.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger.Log
的用法示例。
在下文中一共展示了Log.save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: evolve
# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import save [as 别名]
def evolve(self):
game_init()
it_num = 0
log = Log(datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d_%H-%M-%S.csv'))
while (it_num < MAX_ITERATIONS and
(
self.solution is None or
TARGET_SCORE == 0 or
self.solution.fitness['score'] < TARGET_SCORE
)
):
self.iteration(it_num)
log.push(it_num, self.population)
if DISPLAY_BEST == 'iteration' or (DISPLAY_BEST == 'best' and self.solution.fitness['score'] > TARGET_SCORE):
print "\nBest on this iteration...\n"
nn = self.population[0].get_neural_network()
play(nn)
it_num += 1
print '\nEvolution terminated with score: {0} and clock: {1}\n'.format(self.solution.fitness['score'], self.solution.fitness['clock'])
log.save()
game_end()
return self.solution