Closed douglasrizzo closed 4 years ago
@douglasrizzo thanks for the contribution!
@douglasrizzo Dear Douglas How can I use it?
The method returns a matrix of dimensions n_agents x n_units
. If agent n
sees unit m
, position (n, m)
in the matrix will be 1. Otherwise, 0.
The method returns a matrix of dimensions
n_agents x n_units
. If agentn
sees unitm
, position(n, m)
in the matrix will be 1. Otherwise, 0.
Thank you. Very helpful enhancement.
The matrix dimensions are
n_agents X (n_agents * n_enemies)
.arr[i, j]
isTrue
if agenti
sees unitj
,False
otherwise. In the longest dimension, agents come first, then enemies. I make use of the fact that all units have the same sight range and takeO(n_agents / 2 + n_agents * n_enemies)
operations to fill the matrix, since the agent/agent part is symmetrical.I have added a call to the new method in the example agent in order to test it but, on second thought, I don't know if that was appropriate.