本文整理匯總了Python中gym.monitoring方法的典型用法代碼示例。如果您正苦於以下問題:Python gym.monitoring方法的具體用法?Python gym.monitoring怎麽用?Python gym.monitoring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gym
的用法示例。
在下文中一共展示了gym.monitoring方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: set_log_dir
# 需要導入模塊: import gym [as 別名]
# 或者: from gym import monitoring [as 別名]
def set_log_dir(self, log_dir):
if self.env.monitor.enabled:
self.env.monitor.close()
if log_dir is not None:
self.env.monitor.start(log_dir, self.video_schedule)
self.monitoring = True
else:
self.monitoring = False
示例2: terminate
# 需要導入模塊: import gym [as 別名]
# 或者: from gym import monitoring [as 別名]
def terminate(self):
if self.monitoring:
self.env.monitor.close()
self.env.close() # Prevents a memory leak
# NB: adding a close(self) routine that also closes the env does not have any effect
示例3: __init__
# 需要導入模塊: import gym [as 別名]
# 或者: from gym import monitoring [as 別名]
def __init__(self, env, pms, type="origin"):
self.env = env
self.type = type
self.video_schedule = None
self.pms = pms
if not self.pms.record_movie:
self.video_schedule = NoVideoSchedule()
else:
if self.video_schedule is not None:
self.video_schedule = CappedCubicVideoSchedule()
self.env.monitor.start("log/trpo" ,self.video_schedule, force=True)
self.monitoring = True