## 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 colored circles or squares.
* **Color Coding:** 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 by a distinct symbol (e.g., a star, a flag) or color.
### 3. Path Visualization
* **Path Lines:** The planned path for each agent is displayed as a series of connected lines.
* **Path Color:** Path lines are often displayed in the same color as the corresponding agent.
* **Path Thickness:** Path thickness can be adjusted for visual clarity.
* **Real-time Updates:** The visualization updates in real-time as agents move along their planned paths.
### 4. Collision Avoidance
* **Collision Detection:** The system detects potential collisions between agents.
* **Collision Resolution:** When a collision is detected, the system replans the paths of the involved agents to avoid the collision.
* **Visualization of Conflicts:** Potential collisions can be highlighted visually (e.g., by flashing the agents involved or displaying a warning symbol).
### 5. Algorithm Parameters (Configurable)
| Parameter | Description | Default Value |
| ------------------ | ----------------------------------------- | ------------- |
| Number of Agents | The number of agents in the environment. | 10 |
| Grid Width | The width of the grid. | 20 |
| Grid Height | The height of the grid. | 20 |
| Obstacle Density | The percentage of cells occupied by obstacles. | 0.2 |
| Planning Algorithm | The path planning algorithm used. | CBS |
| Visualization Speed| The speed at which the visualization updates.| 1x |
### 6. Data Output
* **Agent Positions:** The current (x, y) coordinates of each agent.
* **Agent Paths:** The sequence of (x, y) coordinates representing the planned path for each agent.
* **Collision Events:** A log of all detected and resolved collision events.
* **Performance Metrics:** Metrics such as path length, planning time, and collision rate.
### 7. User Interface (UI) Elements
* **Start/Pause Button:** Controls the simulation.
* **Step Button:** Advances the simulation by one time step.
* **Parameter Controls:** Allows users to adjust the algorithm parameters.
* **Visualization Controls:** Allows users to customize the visualization (e.g., colors, path thickness).
* **Data Display:** Displays the agent positions, paths, collision events, and performance metrics.