AgentBase Library

Agent Based Modeling (ABM) in the browser

Download this project as a .zip file Download this project as a tar.gz file


The AgentBase software library allows you to build Agent Based Models (ABMs) that run in the browser. It follows NetLogo's Agent oriented Programming model and is entirely implemented in CoffeeScript. Tinker with models on or drop by our Google Group to get involved. Documentation is here.


Two models running right in your browser.

Sample models

Have a look at these example models.

Template shows the basic structure of a model and is a good place to get started when you want to try building your own. Advanced Template is more elaborate.

Ants is a model of ant foraging behavior incorporating a nest location and food pheromone diffusion.

Buttons provides Stuart Kauffman's example of randomly connecting pairs of buttons in a pile resulting in a tipping point.

Diffusion has randomly flying agents on a patch grid dropping a color which is diffused over the grid.

Fire is a cellular automata model of fire spreading.

Flock is the classic "boids" model where agents each follow three simple rules resulting in realistic flocking. This example uses the as.dat.gui.js extra.

Grid Path shows one of Knuth's great puzzles on the probability of all Manhattan traversals diagonally traversing a grid.

Life provides an implementation of Conway's Game of Life with a twist. This example demonstrates running multiple models on the same page.

Link Travel has agents traversing a graph of nodes and links.

N body is a simulation of the nonlinear gravitation of n bodies.

Preferential Attachment models a dynamic graph where new links preferentially attach to the nodes that have the most links. This results in a power-law distribution.

Traveling Salesman demonstrates a Traveling Sales Person solution via a Genetic Algorithm showing the rapid conversion of stochastic methods.