# Mesa

Python agent\-based modeling framework with data collection and browser visualization\.

ID: Q677 · Revision: 725

Type: software · License: Apache\-2\.0[^me-home] · Status: active

Website: https://mesa.readthedocs.io/



Mesa is an Apache\-2\.0\-licensed Python framework for agent\-based modeling\. It provides model and agent components, spatial structures, data collection and browser\-based visualization while leaving the simulated rules in the author's Python code\.[^me-home]

## Building agent models

AgentSet manages collections of agents and supports explicit activation patterns\. Authors can combine framework components with custom implementations to represent interactions and collect observations\. This approach suits teams that want their simulation logic inside a Python project rather than a separate modeling language\. A browser visualization is a presentation layer, not evidence that the model requires no Python runtime\.[^me-home][^me-migrate]

## Collecting useful observations

DataCollector distinguishes model\-wide, individual\-agent, agent\-type and table data\. Reporters select attributes or compute values when collection occurs, and the accumulated records can become pandas data frames\. Choosing reporters and collection intervals is part of experimental design: gathering every value does not automatically identify the quantities needed to assess a hypothesis\.[^me-data]

## Version migration

The migration guide documents changes to agent initialization, identifiers, scheduling and visualization\. Older examples based on scheduler classes should not be assumed to run unchanged with current AgentSet workflows\. More recent guidance also makes random seeds explicit for repeated batch experiments\. Version and seed choices should accompany reference outputs when a model is shared or upgraded\.[^me-migrate]

## Deployment and rights

Mesa's core is open source under Apache\-2\.0\. Visualization, plotting and network\-modeling workflows can require recommended optional dependencies in addition to the basic package\. The data\-collection documentation also notes a serialization limitation when reporters use lambda functions\. A portable project therefore includes dependency and reporter choices, not just the main model class\.[^me-home][^me-data]

## When it substitutes

Mesa can replace [NetLogo](/netlogo) for custom agent\-based simulations when Python integration and programmatic data analysis are priorities\. This assessment assumes a rewrite of behavior and experiment controls, not direct loading of NetLogo files\. Activation order, random inputs, observations and visual controls must be compared before the rewritten model is treated as equivalent\.[^me-home][^me-migrate][^me-data][^nl-about]

## Capabilities and substitutions

### Agent\-based authoring — supported

Python model components and AgentSet support custom agent rules\.[^me-home]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

### Analysis outputs — supported

DataCollector produces pandas\-compatible model and agent records\.[^me-data]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

### Old\-version model compatibility — limited

Scheduling, initialization and visualization APIs have migration requirements\.[^me-migrate]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

### [Substitute for NetLogo](/netlogo) — limited

Substitutes for custom agent\-based experiments rebuilt in Python; no native NetLogo project importer is established\.[^me-home][^me-migrate][^nl-about]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

## References

[^me-home]: [Mesa overview](<https://mesa.readthedocs.io/stable/>) — Apache2 Python agent framework, Solara and optional dependencies (vendor; retrieved 2026-10-07T09:47:58Z)

[^me-migrate]: [Mesa migration guide](<https://mesa.readthedocs.io/stable/migration_guide.html>) — AgentSet, seeding, visualization and scheduling changes (vendor; retrieved 2026-10-07T09:48:07Z)

[^me-data]: [Mesa data collection](<https://mesa.readthedocs.io/stable/apis/datacollection.html>) — Model/agent reporters, pandas outputs and serialization caveat (vendor; retrieved 2026-10-07T09:48:51Z)

[^nl-about]: [What is NetLogo?](<https://docs.netlogo.org/whatis>) — Agents, desktop platforms and authoring (vendor; retrieved 2026-10-07T09:32:52Z)

Source revision: https://substitutefor.net/entities/Q677?revision=725
