Skip to content

feat: Add Swarm Minefield Mapper (Dynamic Agent Role management and co-operation)#365

Open
apfine wants to merge 4 commits intomesa:mainfrom
apfine:feat/swarm-minefield-mapper
Open

feat: Add Swarm Minefield Mapper (Dynamic Agent Role management and co-operation)#365
apfine wants to merge 4 commits intomesa:mainfrom
apfine:feat/swarm-minefield-mapper

Conversation

@apfine
Copy link

@apfine apfine commented Mar 7, 2026

Description

This PR introduces the Swarm Minefield navigator, a deterministic, production-oriented spatial navigation model. It simulates a heterogeneous drone swarm (1 Leader, 3 Followers) tasked with mapping a strict 1-meter safe corridor through a dense, dynamically generated minefield under partial observability.

I built this model to establish a mathematically rigorous spatial baseline in preparation for a GSoC 2026 proposal.

Key Technical Implementations:

  • Strict A Verification:* The final path extraction requires a cell and all 8 of its Moore neighbors to be explicitly scanned and safe.
  • Dynamic Leadership Handoff: If the Leader drone is trapped, a Follower with better forward (Y-axis) progress automatically assumes the Leader role, triggering the swarm to rally to the new coordinates.
  • Macro-Node DFS Backtracking: The Leader actively drops Checkpoints at fully safe intersections. If it detects a soft-deadlock (via a frustration timer), it retreats and explicitly paints the abandoned branch as a DEAD_END in the global mesh network.
  • Airborne Regrouping: Followers utilize a distinct behavioral state to temporarily bypass ground hazards (ignoring safety buffers) when rallying to a retreating Leader.

(Note: Please see the attached GIFs/Screenshots below demonstrating the trap-escape and dynamic handoff logic.)

mesa-swarm-gif

The swarm can be seen navigating a minefield with 450 mines in 100 X 100 grid .

You can read Readme of the project to know about all other configurations.

Motivation

The goal of this deterministic expert system is to serve as the foundation for an LLM-integration project. For GSoC, I plan to propose using the mesa-llm module to replace these hardcoded state machines (like the frustration timer and U-trap detection) with local LLM-driven spatial reasoning and semantic memory.

Checklist

  • Code follows PEP8 formatting guidelines.
  • Includes README.md with instructions and architecture details.
  • Includes requirements.txt (only requires mesa).
  • Unit tests provided in tests/test_model.py.

@apfine
Copy link
Author

apfine commented Mar 7, 2026

pre-commit.ci autofix

@apfine apfine force-pushed the feat/swarm-minefield-mapper branch from c146894 to 102f0ae Compare March 7, 2026 12:43
@apfine
Copy link
Author

apfine commented Mar 7, 2026

pre-commit.ci autofix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant