Skip to main content

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.

Robotaxi Zoox is a classical AI search problem in which an autonomous taxi must navigate a grid-based city, pick up every waiting passenger, and finally reach a designated destination. Because the taxi must satisfy multiple pickup objectives before the trip is complete, a simple shortest-path formulation is not sufficient — the problem is modelled as a multi-goal search where the state tracks both where the taxi is and which passengers have already been collected. This page describes every element of that model: the environment, the agent, movement rules, movement costs, and the precise goal condition that signals a successful run.

The Environment

The city is represented as a rectangular grid of cells. Each cell belongs to exactly one type, identified by an integer constant defined on the Grid class:
ConstantValueNameDescription
Grid.LIBRE0Free roadOpen cell the taxi can drive through
Grid.MURO1WallImpassable obstacle (buildings, barriers)
Grid.INICIO2StartSpawn point of the robotaxi
Grid.FLUJO_ALTO3High trafficPassable but slow — heavy congestion zone
Grid.PASAJERO4PassengerA waiting passenger the taxi must collect
Grid.DESTINO5DestinationThe final drop-off point the taxi must reach
The Grid object reads the raw integer matrix and automatically scans it to locate the special cells:
from mundo import Grid, leer_mapa

matriz = leer_mapa('mapas/test/Prueba1.txt')
grid = Grid(matriz)

print(grid.inicio)    # e.g. (2, 0)
print(grid.destino)   # e.g. (5, 9)
print(grid.pasajeros) # e.g. [(0, 0), (6, 0)]
grid.inicio and grid.destino are (row, col) tuples, while grid.pasajeros is a list of all passenger positions in reading order.
All passengers share a single destination. The taxi collects every passenger along the route and drops them off together at grid.destino — there is no per-passenger drop-off logic.

The Agent

The robotaxi begins each search at the cell marked Grid.INICIO (2). Its mission has two sequential phases:
  1. Collection phase — visit every cell marked Grid.PASAJERO (4). Passengers are picked up automatically the moment the taxi enters their cell; no explicit action is needed.
  2. Delivery phase — after all passengers are aboard, navigate to the cell marked Grid.DESTINO (5).
The agent has no pre-computed route. A search algorithm (BFS, UCS, DFS, Greedy, or A*) explores the state space and finds the sequence of moves that satisfies both phases.

Movement Rules

From any cell, the taxi can attempt to move in four directions: right, up, down, and left. These correspond to the movimientos list inside Grid.get_vecinos:
movimientos = [(0, 1), (-1, 0), (1, 0), (0, -1)]
# right       up        down      left
A move is only executed if the target cell is transitable — meaning it exists within the grid bounds and is not a Grid.MURO cell. All other cell types (LIBRE, INICIO, FLUJO_ALTO, PASAJERO, DESTINO) are passable.

Movement Cost

Each time the taxi enters a new cell, a step cost is incurred. The accumulated cost g is tracked on every search node and is used by cost-sensitive algorithms like UCS and A*.
Cell typeConstantStep cost
Free roadGrid.LIBRE1
StartGrid.INICIO1
PassengerGrid.PASAJERO1
DestinationGrid.DESTINO1
High trafficGrid.FLUJO_ALTO7
WallGrid.MURO— (impassable)
High-traffic cells (FLUJO_ALTO) cost 7 to enter — seven times the cost of a normal road cell. Algorithms that minimise total cost will actively route around these zones unless doing so would require an even more expensive detour.

Goal Condition

A search node is considered the goal when two conditions are simultaneously true:
nodo.posicion == grid.destino and nodo.pasajeros_recogidos == pasajeros_totales
  • nodo.posicion == grid.destino — the taxi has physically arrived at the destination cell.
  • nodo.pasajeros_recogidos == pasajeros_totales — the set of collected passengers equals the full set of passengers on the map.
Reaching the destination without having collected every passenger does not satisfy the goal. Equally, collecting all passengers but remaining away from the destination does not satisfy the goal either. Both conditions must hold at the same time.

Build docs developers (and LLMs) love