本文整理汇总了Python中logger.Log.write_log方法的典型用法代码示例。如果您正苦于以下问题:Python Log.write_log方法的具体用法?Python Log.write_log怎么用?Python Log.write_log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger.Log
的用法示例。
在下文中一共展示了Log.write_log方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MinMax
# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import write_log [as 别名]
class MinMax():
def __init__(self, gui, game):
self.gui = gui
self.game = game
self.log = Log()
def run(self):
try:
# Create a state of the initial game
self.state = State(self.game.grid)
free, highest = self.state.free_tiles()
# Run the algorithm one step
if free <= 1:
root = TreeNode(self.state, None, 7)
elif free <= 2:
root = TreeNode(self.state, None, 6)
elif free <= 3:
root = TreeNode(self.state, None, 4)
elif free <= 6:
root = TreeNode(self.state, None, 3)
else:
root = TreeNode(self.state, None, 3)
# root = TreeNode(self.state, None, 4)
# Chose dept depentdent on free tiles
direc, way = root.get_move()
# Log the move
if way is None:
# self.log.write_log()
pass
else:
self.log.add_log(copy.deepcopy(self.game.grid), way)
self.log.write_log()
return direc, highest
except Exception, err:
eprint(err)