## System Overview: Multi-Agent Path Finding (MAPF) Visualization
This document details the visualization of a Multi-Agent Path Finding (MAPF) system. The visualization displays agents navigating a grid-based environment, avoiding collisions and reaching their designated goals.
### 1. Environment Representation
* **Grid:** The environment is represented as a 2D grid. Each cell in the grid can be either:
* **Free Space:** Represents navigable areas.
* **Obstacle:** Represents blocked areas that agents cannot traverse.
* **Dimensions:** The grid dimensions are configurable (e.g., 20x20, 50x50).
* **Visualization:** Free space is typically displayed as white or a light color, while obstacles are displayed as black or a dark color.
### 2. Agent Representation
* **Shape:** Agents are visually represented as circles, squares, or other distinct shapes.
* **Color:** Each agent is assigned a unique color for easy identification.
* **Size:** Agent size is proportional to their radius or dimensions.
* **Goal:** Each agent has a designated goal location, marked on the grid with a distinct symbol (e.g., a star, a target icon).
### 3. Path Visualization
* **Path Lines:** The planned path for each agent is visualized as a series of connected lines.
* **Path Color:** Path lines are colored differently from the agent's color to distinguish the path from the agent itself.
* **Path Thickness:** Path line thickness can be adjusted for clarity.
* **Real-time Updates:** The path visualization updates in real-time as agents move and replanning occurs.
### 4. Collision Avoidance Visualization
* **Collision Detection:** The system detects potential collisions between agents.
* **Collision Warning:** When a potential collision is detected, a visual warning is displayed (e.g., a flashing border around the agents, a highlighted area).
* **Resolution:** The visualization shows how the system resolves collisions, either through replanning or by adjusting agent speeds.
### 5. Performance Metrics
* **Makespan:** The total time taken for all agents to reach their goals. Displayed numerically.
* **Number of Conflicts:** The total number of times agents had to resolve collisions. Displayed numerically.
* **Path Lengths:** The total distance traveled by each agent. Displayed numerically.
* **Computation Time:** The time taken to compute the paths. Displayed numerically.
### 6. User Interface (UI) Controls
* **Start/Pause/Stop:** Buttons to control the simulation.
* **Grid Size:** Input field to adjust the grid dimensions.
* **Number of Agents:** Input field to adjust the number of agents.
* **Agent Speed:** Slider to adjust the speed of the agents.
* **Algorithm Selection:** Dropdown menu to select the MAPF algorithm (e.g., CBS, ECBS).
* **Visualization Options:** Checkboxes or toggles to control the display of paths, collisions, and performance metrics.
### 7. Data Table Example
| Metric | Value | Unit |
| ------------------ | ----- | ------ |
| Makespan | 15.2 | seconds |
| Number of Conflicts | 5 | |
| Average Path Length| 8.7 | units |
| Computation Time | 0.5 | seconds |