本文整理汇总了Python中game_state.GameState.close_record_screen_dir方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.close_record_screen_dir方法的具体用法?Python GameState.close_record_screen_dir怎么用?Python GameState.close_record_screen_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_state.GameState
的用法示例。
在下文中一共展示了GameState.close_record_screen_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: choose_action
# 需要导入模块: from game_state import GameState [as 别名]
# 或者: from game_state.GameState import close_record_screen_dir [as 别名]
steps = 0
reward = 0
while True:
pi_values = global_network.run_policy(sess, game_state.s_t)
action = choose_action(pi_values)
game_state.process(action)
if game_state.reward != 0:
reward += game_state.reward
print("SCORE=", reward)
# terminate if the play time is too long
steps += 1
terminal = game_state.terminal
if steps > options.max_play_steps:
terminal = True
if terminal:
game_state.reset()
print("Game finised with score=", reward)
break
else:
game_state.update()
if (not options.use_gym) and (options.record_screen_dir is not None):
new_episode_record_dir = episode_record_dir + "-r{:04d}-s{:04d}".format(reward, steps)
os.rename(episode_record_dir, new_episode_record_dir)
if options.use_gym:
game_state.close_record_screen_dir()