Current code
def apply_environment_force(self, force):
for agent_id, agent in enumerate(self.agents):
# Check if there is a collision against other agents.
next_pos = agent.xy + force[agent_id]
for i, a in enumerate(self.agents):
if agent_id == i:
continue
if all(next_pos == a.xy):
force[agent_id] = np.zeros(2, dtype=np.int8)
agent.collide_agents = True
break
...
Should be ...
Refactor the code by using self.map.agents_matrix
Current code
Should be ...
Refactor the code by using self.map.agents_matrix