Commit 8e4c695c authored by Yuxin Wu's avatar Yuxin Wu

recv ACK after action

parent 1555899d
...@@ -59,6 +59,7 @@ class SimulatorProcess(multiprocessing.Process): ...@@ -59,6 +59,7 @@ class SimulatorProcess(multiprocessing.Process):
action = loads(data) action = loads(data)
reward, isOver = player.action(action) reward, isOver = player.action(action)
c2s_socket.send(dumps((reward, isOver)), copy=False) c2s_socket.send(dumps((reward, isOver)), copy=False)
noop = s2c_socket.recv(copy=False)
#cnt += 1 #cnt += 1
#if cnt % 100 == 0: #if cnt % 100 == 0:
#print_total_timer() #print_total_timer()
...@@ -122,9 +123,9 @@ class SimulatorMaster(threading.Thread): ...@@ -122,9 +123,9 @@ class SimulatorMaster(threading.Thread):
reward, isOver = loads(msg) reward, isOver = loads(msg)
client.memory[-1].reward = reward client.memory[-1].reward = reward
if isOver: if isOver:
self._on_episode_over(client) self._on_episode_over(ident)
else: else:
self._on_datapoint(client) self._on_datapoint(ident)
@abstractmethod @abstractmethod
def _on_state(self, state, ident): def _on_state(self, state, ident):
......
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