The observation returned at each step is a tuple containing three JAX arrays:
grid: A jax.array (int32) of shape (grid_size, grid_size). This 2D matrix represents the positions, targets, and paths of all agents.action_mask: A jax.array (bool) of shape (num_agents, 5). This indicates the valid actions available to each agent.step_count: A jax.array (int32) of shape () representing the number of steps taken since the last reset.
Grid Encoding
Agents are encoded in groups of 3 integers. For any agent $i$ (where $i$ starts at 0), the components are mapped as follows:
- Path:
1 + (3 * i) - Position:
2 + (3 * i) - Target:
3 + (3 * i)
Example Encoding (Agent 1, 2, and 3):
- Agent 1: Path=1, Position=2, Target=3
- Agent 2: Path=4, Position=5, Target=6
- Agent 3: Path=7, Position=8, Target=9