|
|
|
|
|
|
import glob |
|
|
|
import io |
|
|
|
import logging |
|
|
|
import math |
|
|
|
import numpy as np |
|
|
|
import os |
|
|
|
import subprocess |
|
|
|
|
|
|
else: |
|
|
|
[x.memories.extend([0] * (memory_size - len(x.memories))) for x in agent_info_list] |
|
|
|
memory = np.array([x.memories for x in agent_info_list]) |
|
|
|
if any([math.isnan(x.reward) for x in agent_info_list]): |
|
|
|
logger.warning("An agent had a NaN reward for brain "+b) |
|
|
|
reward=[x.reward for x in agent_info_list], |
|
|
|
reward=[x.reward if not math.isnan(x.reward) else 0 for x in agent_info_list], |
|
|
|
agents=[x.id for x in agent_info_list], |
|
|
|
local_done=[x.done for x in agent_info_list], |
|
|
|
vector_action=np.array([x.stored_vector_actions for x in agent_info_list]), |
|
|
|