Commit 33353f33 authored by Yuxin Wu's avatar Yuxin Wu

a default implementation for restart_episode

parent dee9d398
......@@ -86,7 +86,7 @@ class LimitLengthPlayer(ProxyPlayer):
isOver = True
self.player.restart_episode()
if isOver:
print self.cnt
#print self.cnt, self.player.stats # to see what limit is appropriate
self.cnt = 0
return (r, isOver)
......
......@@ -29,9 +29,9 @@ class RLEnvironment(object):
:returns: (reward, isOver)
"""
@abstractmethod
def restart_episode(self):
""" Start a new episode, even if the current hasn't ended """
raise NotImplementedError()
def get_stat(self):
"""
......
......@@ -44,7 +44,7 @@ class StoppableThread(threading.Thread):
try:
q.put(obj, timeout=5)
break
except queue.Queue.Full:
except queue.Full:
pass
def queue_get_stoppable(self, q):
......@@ -52,7 +52,7 @@ class StoppableThread(threading.Thread):
while not self.stopped():
try:
return q.get(timeout=5)
except queue.Queue.Full:
except queue.Empty:
pass
class LoopThread(threading.Thread):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment