Metadata-Version: 2.4
Name: swarm-squad
Version: 0.1.7
Summary: Swarm Squad: A simulation framework for multi-agent systems.
Project-URL: Homepage, https://swarm-squad.com
Project-URL: Documentation, https://docs.swarm-squad.com
Project-URL: Repository, https://github.com/Swarm-Squad/Swarm-Squad
Author-email: Sang Buster <hello@singsongaftermath.com>
License: MIT License
        
        Copyright (c) 2023 Sang Xing
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: dash-bootstrap-components>=2.0.0
Requires-Dist: dash-iconify>=0.1.2
Requires-Dist: dash-mantine-components>=1.1.1
Requires-Dist: dash>=3.0.2
Requires-Dist: flask-cors>=5.0.1
Requires-Dist: matplotlib>=3.10.1
Requires-Dist: pandas>=2.2.3
Requires-Dist: pyqt5>=5.15.11
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: websockets>=15.0.1
Description-Content-Type: text/markdown

<div align="center">
   <a href="https://github.com/Sang-Buster/Swarm-Squad">
      <img src="https://raw.githubusercontent.com/Swarm-Squad/Swarm-Squad/refs/heads/main/src/swarm_squad/assets/favicon.png" width=20% alt="logo">
   </a>   
   <h1>Swarm Squad</h1>
   <h5>A simulation framework for multi-agent systems.</h5>
   <a href="https://swarm-squad.vercel.app/">
   <img src="https://img.shields.io/badge/Web-282c34?style=for-the-badge&logoColor=white" />
   </a> &nbsp;&nbsp;
   <a href="https://swarm-squad-doc.vercel.app/">
   <img src="https://img.shields.io/badge/Doc-282c34?style=for-the-badge&logoColor=white" />
   </a>
</div>

---

<div align="center">
  <h2>✨ Key Features</h2>
</div>

<p align="center">
  <img src="https://raw.githubusercontent.com/Swarm-Squad/Swarm-Squad/refs/heads/main/src/swarm_squad/assets/screenshots/home.png" width="500" />
  <img src="https://raw.githubusercontent.com/Swarm-Squad/Swarm-Squad/refs/heads/main/src/swarm_squad/assets/screenshots/nav.png" width="500" />
</p>

<p align="center">
  <img src="https://raw.githubusercontent.com/Swarm-Squad/Swarm-Squad/refs/heads/main/src/swarm_squad/assets/screenshots/map.png" width="500" />
  <img src="https://raw.githubusercontent.com/Swarm-Squad/Swarm-Squad/refs/heads/main/src/swarm_squad/assets/screenshots/data.png" width="500" />
</p>

- **Agent Simulation:** Simulates multiple agents in a shared environment.
- **Scalability:** Handles large-scale agent simulations efficiently.
- **Behavior Specs:** Define and test agent behavior against expected outcomes.
- **Environment Modeling:** Build and manage physical or virtual environments.
- **Analytics:** Collect metrics on speed, coordination, and performance.
- **Customizable:** Easily extend agents, environments, and evaluation logic.
- **Visualization:** Real-time views and post-run reports of simulations.
- **Tool Integration:** Connect with RL libraries, protocols, or visual tools.
- **Versatile Agents:** Supports robots, drones, and autonomous vehicles.
- **Docs & Support:** Includes clear documentation and helpful resources.

---

<div align="center">
  <h2>🚀 Getting Started</h2>
</div>

It is recommended to use [uv](https://docs.astral.sh/uv/getting-started/installation/) to create a virtual environment and install the following package.

```bash
uv pip install swarm-squad
```

To run the application, simply type:

```bash
swarm-squad
# or
swarm-squad --help
```

---

<div align="center">
  <h2>👨‍💻 Development Setup</h2>
</div>

1. **Clone the repository and navigate to project folder:**

   ```bash
   git clone https://github.com/Sang-Buster/Swarm-Squad
   cd Swarm-Squad
   ```

2. **Install uv first:**

   ```bash
   # macOS/Linux
   curl -LsSf https://astral.sh/uv/install.sh | sh
   ```

   ```powershell
   # Windows
   powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
   ```

3. **Install the required packages:**
   **Option 1 (recommended):** Synchronizes environment with dependencies in pyproject.toml and uv.lock

   ```bash
   uv sync
   source .venv/bin/activate # .venv\Scripts\activate for Windows
   ```

   **Option 2 (manual):** Manual editable installation without referencing lockfile

   ```bash
   uv venv --python 3.10 # Create virtual environment
   source .venv/bin/activate # .venv\Scripts\activate for Windows
   uv pip install -e .
   ```

4. **Set up environment variables:**

   ```bash
   # Copy the example environment file
   cp .env.example .env
   ```

   - You can get a `MAPBOX_ACCESS_TOKEN` by signing up at https://www.mapbox.com/
   - Update the `OLLAMA_API_URL` if your Ollama instance is running on a different address
   - Update the `DATABASE_PATH` if you want to use a custom database file

5. **Install ruff and pre-commit:**

   ```bash
   uv pip install ruff pre-commit
   ```

   - `ruff` is a super fast Python linter and formatter.
   - `pre-commit` helps maintain code quality by running automated checks before commits are made.

6. **Install git hooks:**

   ```bash
   pre-commit install --install-hooks
   ```

   These hooks perform different checks at various stages:

   - `commit-msg`: Ensures commit messages follow the conventional format
   - `pre-commit`: Runs Ruff linting and formatting checks before each commit
   - `pre-push`: Performs final validation before pushing to remote

7. **Code Linting & Formatting:**

   ```bash
   ruff check --fix
   ruff check --select I --fix
   ruff format
   ```

8. **Run the application:**
   ```bash
   uv run src/swarm_squad/app.py
   ```

---

<div align="center">
  <h2>📝 File Structure</h2>
</div>

```text
📂Swarm Squad
 ┣ 📂src                         // Source Code
 ┃ ┗ 📦swarm_squad                  //
 ┃ ┃ ┣ 📂assets                     // Static assets (CSS, images, favicon, etc.)
 ┃ ┃ ┃ ┣ 📂css                      // CSS files
 ┃ ┃ ┃ ┣ 📂js                       // JavaScript files
 ┃ ┃ ┃ ┣ 📂models                   // Model files
 ┃ ┃ ┃ ┣ 📄favicon.ico              // Favicon
 ┃ ┃ ┃ ┗ 📄favicon.png              // Favicon
 ┃ ┃ ┣ 📂cli                        // CLI commands
 ┃ ┃ ┣ 📂components                 // Reusable UI components
 ┃ ┃ ┣ 📂data                       // Database files
 ┃ ┃ ┣ 📂pages                      // Page components and routing
 ┃ ┃ ┣ 📂scripts                    // Simulation and algorithm scripts
 ┃ ┃ ┣ 📂utils                      // Utility functions and helpers
 ┃ ┃ ┣ 📂cli                        // CLI commands
 ┃ ┃ ┣ 📄app.py                     // Entry point
 ┃ ┃ ┗ 📄core.py                    // Dash app core
 ┣ 📄.env.example                // Template for environment variables
 ┣ 📄.gitignore                  // Git ignore patterns (env, cache, database)
 ┣ 📄.pre-commit-config.yaml     // Pre-commit hooks (ruff, commit message)
 ┣ 📄.python-version             // Python version
 ┣ 📄LICENSE                     // MIT License
 ┣ 📄README.md                   // Project documentation
 ┣ 📄pyproject.toml              // Project configuration
 ┗ 📄uv.lock                     // Lock file
```
