Getting started#

Mesa is a modular framework for building, analyzing and visualizing agent-based models.

Agent-based models are computer simulations involving multiple entities (the agents) acting and interacting with one another based on their programmed behavior. Agents can be used to represent living cells, animals, individual humans, even entire organizations or abstract entities. Sometimes, we may have an understanding of how the individual components of a system behave, and want to see what system-level behaviors and effects emerge from their interaction. Other times, we may have a good idea of how the system overall behaves, and want to figure out what individual behaviors explain it. Or we may want to see how to get agents to cooperate or compete most effectively. Or we may just want to build a cool toy with colorful little dots moving around.

Overview#

If you want to get a general idea of Mesa’s features and structure, start here:

Tutorials#

If you want to learn how to build agent-based models step by step using Mesa, follow these tutorials:

  • Creating Your First Model: Learn how to create your first Mesa model.

  • AgentSet: Learn how to more effectively manage agents with Mesa’s AgentSet.

  • Agent Activation: Learn different ways to activate agents using do, shuffle_do, and map — covering random, sequential, simultaneous, staged, type-based, and conditional activation patterns.

  • Event Scheduling: Learn how to schedule events and manage time in your Mesa model.

  • Adding Space: Learn how to add space to your Mesa model and understand Mesa’s space architecture.

  • Collecting Data: Learn how to collect model level and agent level data with Mesa’s DataCollector.

  • Basic Visualization: Learn how to build an interactive dashboard with Mesa’s visualization module.

  • Dynamic Agent Visualization: Learn how to dynamically represent your agents in your interactive dashboard.

  • Visualization using SpaceRenderer: Learn how to use SpaceRenderer to its full extent to enhance your visualizations.

  • Property Layer Visualization: Learn how to visualize property layers in Mesa.

  • Custom Visualization Components: Learn how to add custom visual components to your interactive dashboard.

  • Parameter Sweeps: Learn how to conduct parameter sweeps on multiple processors with Mesa’s BatchRunner.

  • Comparing Scenarios: Think through how to analyze your parameter sweep results to find insight in your Mesa simulations.

Examples#

Mesa ships with a collection of example models. These are classic ABMs, so if you are familiar with ABMs and want to get a quick sense of how MESA works, these examples are great place to start. You can find them here.

Further resources#

To further explore Mesa and its features, we have the following resources available:

Best practices#

API documentation#

Repository of models built using MESA#

Migration guide#

  • Mesa 3.0 Migration guide: If you’re upgrading from an earlier version of Mesa, this guide will help you navigate the changes in Mesa 3.0.

Source Code and development#

  • Mesa GitHub repository: Access the full source code of Mesa, contribute to its development, or report issues.

  • Mesa release notes: View the detailed changelog of Mesa, including all past releases and their features.

Community and support#

Enjoy modelling with Mesa, and feel free to reach out!