Mesa: Agent-based modeling in Python#

https://github.com/projectmesa/mesa/workflows/build/badge.svg https://codecov.io/gh/projectmesa/mesa/branch/main/graph/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/matrix/project-mesa:matrix.org?label=chat&logo=Matrix

Mesa is an Apache2 licensed agent-based modeling (or ABM) framework in Python.

Mesa allows users to quickly create agent-based models using built-in core components (such as spatial grids and agent schedulers) or customized implementations; visualize them using a browser-based interface; and analyze their results using Python’s data analysis tools. Its goal is to be the Python-based counterpart to NetLogo, Repast, or MASON.

A screenshot of the Wolf Sheep model in Mesa|100% A visualisation of the Wolf Sheep model build with Mesa.

Features#

  • Built-in core modeling components

  • Flexible agent and model management through AgentSet

  • Browser-based Solara visualization

  • Built-in tools for data collection and analysis

  • Example model library

Using Mesa#

Installation Options#

To install our latest stable release (3.0.x), run:

pip install -U mesa

To also install our recommended dependencies:

pip install -U mesa[rec]

On a Mac, this command might cause an error stating zsh: no matches found: mesa[all]. In that case, change the command to pip install -U "mesa[rec]".

To install our latest pre-release:

pip install -U --pre mesa[rec]

Resources#

For help getting started with Mesa, check out these resources:

Development and Support#

Mesa is an open source project and welcomes contributions:

The original Mesa conference paper is available here.

Indices and tables#