|
|
|
|
|
|
# We make sure to empty the policy queue before continuing to produce steps. |
|
|
|
# This halts the trainers until the policy queue is empty. |
|
|
|
while True: |
|
|
|
_policy = self.agent_managers[brain_name].policy_queue.get( |
|
|
|
block=False |
|
|
|
) |
|
|
|
_policy = self.agent_managers[brain_name].policy_queue.get_nowait() |
|
|
|
except AgentManagerQueue.Empty: |
|
|
|
if _policy is not None: |
|
|
|
self.set_policy(brain_name, _policy) |
|
|
|