Mesa Core Examples#
This repository contains a curated set of classic agent-based models implemented using Mesa. These core examples are maintained by the Mesa development team and serve as both demonstrations of Mesa’s capabilities and starting points for your own models.
Overview#
The examples are categorized into two groups:
Basic Examples - Simpler models that use only stable Mesa features; ideal for beginners
Advanced Examples - More complex models that demonstrate additional concepts and may use some experimental features
Note: Looking for more examples? Visit the mesa-examples repository for user-contributed models and showcases.
Basic Examples#
The basic examples are relatively simple and only use stable Mesa features. They are good starting points for learning how to use Mesa.
Boltzmann Wealth Model#
Completed code to go along with the tutorial on making a simple model of how a highly-skewed wealth distribution can emerge from simple rules.
Boids Flockers Model#
Boids-style flocking model, demonstrating the use of agents moving through a continuous space following direction vectors.
Conway’s Game of Life#
Implementation of Conway’s Game of Life, a cellular automata where simple rules can give rise to complex patterns.
Schelling Segregation Model#
Mesa implementation of the classic Schelling segregation model.
Virus on a Network Model#
This model is based on the NetLogo Virus on a Network model.
Advanced Examples#
The advanced examples are more complex and may use experimental Mesa features. They are good starting points for learning how to build more complex models.
Epstein Civil Violence Model#
Joshua Epstein’s model of how a decentralized uprising can be suppressed or reach a critical mass of support.
Demographic Prisoner’s Dilemma on a Grid#
Grid-based demographic prisoner’s dilemma model, demonstrating how simple rules can lead to the emergence of widespread cooperation – and how a model activation regime can change its outcome.
Sugarscape Model with Traders#
This is Epstein & Axtell’s Sugarscape model with Traders, a detailed description is in Chapter four of Growing Artificial Societies: Social Science from the Bottom Up (1996). The model shows how emergent price equilibrium can happen via decentralized dynamics.
Wolf-Sheep Predation Model#
Implementation of an ecological model of predation and reproduction, based on the NetLogo Wolf Sheep Predation model.