本文整理汇总了Python中game_state.GameState.set_record_screen_dir方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.set_record_screen_dir方法的具体用法?Python GameState.set_record_screen_dir怎么用?Python GameState.set_record_screen_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_state.GameState
的用法示例。
在下文中一共展示了GameState.set_record_screen_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from game_state import GameState [as 别名]
# 或者: from game_state.GameState import set_record_screen_dir [as 别名]
if os.path.exists(psc_fname):
with open(psc_fname, "rb") as f:
psc_info = pickle.load(f)
print("psc_info loaded:", psc_fname)
else:
print("psc_info does not exist and not loaded:", psc_fname)
game_state = GameState(0, options, display=options.display, no_op_max=30, thread_index=0)
# for pseudo-count
if options.psc_use:
game_state.psc_set_psc_info(psc_info)
if options.use_gym and (options.record_screen_dir is not None):
game_state.set_record_screen_dir(options.record_screen_dir)
for episode in range(options.num_episode_record):
episode_record_dir = None
if (not options.use_gym) and (options.record_screen_dir is not None):
episode_dir = options.rom.split(".")[0] + "-e{:03d}".format(episode)
episode_record_dir = os.path.join(options.record_screen_dir, episode_dir)
os.makedirs(episode_record_dir)
game_state.set_record_screen_dir(episode_record_dir)
steps = 0
reward = 0
while True:
pi_values = global_network.run_policy(sess, game_state.s_t)
action = choose_action(pi_values)