Mesa core examples#

These examples are a collection of classic agent based models built using Mesa. These core examples are maintained by the Mesa team and are intended to demonstrate the capabilities of Mesa.

More user examples and showcases can be found in the mesa-examples repository.

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.