Skip to content

examples: add dormant_alliances MetaAgent lifecycle demo#460

Open
gargi025 wants to merge 2 commits intomesa:mainfrom
gargi025:add-dormant-alliances-example
Open

examples: add dormant_alliances MetaAgent lifecycle demo#460
gargi025 wants to merge 2 commits intomesa:mainfrom
gargi025:add-dormant-alliances-example

Conversation

@gargi025
Copy link
Copy Markdown

@gargi025 gargi025 commented Apr 2, 2026

Summary

Adds a new example dormant_alliances demonstrating the MetaAgent lifecycle
features proposed in mesa/mesa#3684.

What it models

Countries (agents) form alliances (MetaAgents). Each step, countries lose power
from attrition. When a country's power hits zero it is defeated and removed. If
an alliance loses more than half its founding members, it goes DORMANT. Dormant
alliances can reactivate if they recruit enough unaffiliated countries to recover.

Features demonstrated

  • MetaAgentState (ACTIVE / DORMANT / DISSOLVED)
  • activate() / deactivate() lifecycle transitions
  • Signal system via on() and emit()
  • cascade_step for automatic member stepping
  • to_dict() for structured logging via DataCollector

Running

Interactive visualization:
solara run examples/dormant_alliances/app.py

Headless:
python examples/dormant_alliances/model.py

Related

gargi025 and others added 2 commits April 3, 2026 02:49
Demonstrates MetaAgentState, activate/deactivate, signal system (on/emit),
cascade_step, and to_dict() from the meta_agents enhancement in
mesa/mesa#3684.

Closes mesa#459
@gargi025
Copy link
Copy Markdown
Author

gargi025 commented Apr 2, 2026

Hi @tpike3 this is the companion example PR to mesa/mesa#3684, demonstrating all the new MetaAgent lifecycle features in a working simulation. Would love your feedback!

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.

Add dormant_alliances example demonstrating MetaAgent lifecycle features

1 participant