Skip to content

Latest commit

 

History

History
 
 

examples

Example Code

This directory contains example models meant to test and demonstrate Mesa's features, and provide demonstrations for how to build and analyze agent-based models. For more information on each model, see its own Readme and documentation.

Color Patches

A cellular automaton model where agents opinions are influenced by that of their neighbors. As the model evolves, color patches representing the prevailing opinion in a given area expand, contract, and sometimes disappear.

ConwaysGameOfLife

Implementation of Conway's Game of Life, a cellular automata where simple rules can give rise to complex patterns.

EpsteinCivilViolence

Joshua Epstein's model of how a decentralized uprising can be suppressed or reach a critical mass of support.

Flockers

Boids-style flocking model, demonstrating the use of agents moving through a continuous space following direction vectors.

ForestFire

Simple cellular automata of a fire spreading through a forest of cells on a grid, based on the NetLogo Fire model.

PD_Grid

Grid-based demographic prisoner's dilemma model, demonstrating how simple mimicing can lead to the emergence of widespread cooperation -- and how a model activation regime can change its outcome.

Schelling

Mesa implementation of the classic Schelling segregation model.

Shape Example

Example of grid display and direction showing agents in the form of arrow-head shape.

Tutorial-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.

WolfSheep

Implementation of an ecological model of predation and reproduction, based on the NetLogo Wolf Sheep Predation model.

Sugarscape CG

Implementation of Sugarscape 2 Constant Growback model, based on the Netlogo Sugarscape 2 Constant Growback