Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Juan-Carlos-Cruz/robotaxi-zoox/llms.txt
Use this file to discover all available pages before exploring further.
Grid models the city map as a 2D integer matrix. It identifies start, destination, and passenger positions at construction time, and exposes movement rules used by every search algorithm. Every search algorithm in Robotaxi Zoox accepts a Grid instance as its environment and delegates all questions about validity, cost, and adjacency to it.
Cell type constants
Each cell in the matrix is represented by one of six integer constants defined as class attributes onGrid. Algorithms and map files both use these values.
| Constant | Value | Description |
|---|---|---|
Grid.LIBRE | 0 | Free road cell — passable, movement cost 1 |
Grid.MURO | 1 | Wall — impassable, blocks all movement |
Grid.INICIO | 2 | Taxi starting position — passable, movement cost 1 |
Grid.FLUJO_ALTO | 3 | High-traffic cell — passable, movement cost 7 |
Grid.PASAJERO | 4 | Passenger pickup cell — passable, movement cost 1 |
Grid.DESTINO | 5 | Goal destination — passable, movement cost 1 |
Constructor
Grid(matriz)
Initialises the grid, computes its dimensions, and scans the matrix once to locate the start cell, destination cell, and all passenger cells.
A rectangular 2D list of integer cell-type values. Each inner list is one
row; all rows must have the same length. Use the class constants
(
Grid.LIBRE, Grid.MURO, etc.) or their raw integer equivalents.| Attribute | Type | Description |
|---|---|---|
matriz | list[list[int]] | The raw cell matrix passed to the constructor |
filas | int | Number of rows |
columnas | int | Number of columns |
inicio | tuple[int, int] | None | (row, col) of the first INICIO cell, or None |
destino | tuple[int, int] | None | (row, col) of the first DESTINO cell, or None |
pasajeros | list[tuple[int, int]] | All PASAJERO positions in reading order |
Methods
es_valida(fila, col)
Returns True when the given coordinates fall inside the grid boundaries.
Row index to check (0-based).
Column index to check (0-based).
True if 0 <= fila < filas and 0 <= col < columnas; False otherwise.es_transitable(fila, col)
Returns True when a cell both exists within the grid and is not a wall (Grid.MURO). This is the primary gate used by get_vecinos to filter candidate moves.
Row index of the target cell.
Column index of the target cell.
True if the cell is in-bounds and its value is not Grid.MURO (1).costo_movimiento(fila, col)
Returns the movement cost the taxi incurs when entering a specific cell. All passable cell types have a cost of 1 except FLUJO_ALTO, which costs 7.
Row index of the destination cell.
Column index of the destination cell.
7 for high-traffic cells (Grid.FLUJO_ALTO); 1 for all other passable
cell types (Grid.LIBRE, Grid.INICIO, Grid.PASAJERO, Grid.DESTINO).get_vecinos(nodo)
The central movement primitive used by every search algorithm. Given a Node, it attempts to step in four cardinal directions and returns a list of new Node objects for every reachable neighbour.
For each passable neighbour the method:
- Computes the new accumulated cost (
nodo.g + costo_movimiento(...)). - Copies the current set of collected passengers.
- If the neighbour cell is
Grid.PASAJERO, adds its coordinates to the passenger set. - Constructs and appends a new
Nodewith the updated state.
The current search state. The method reads
nodo.posicion,
nodo.pasajeros_recogidos, and nodo.g.A list of neighbour nodes, one per passable adjacent cell. The list may be
empty if the taxi is completely surrounded by walls or grid edges.
Neighbours are generated in a fixed order: right
(0, +1), up
(-1, 0), down (+1, 0), left (0, -1). This order is
consistent across all algorithms and affects which paths are explored first
when costs are equal.