The abm_grid Mata class is now available from this github repository. abm_grid is a Mata class intended to help manage a grid for Agent Based models. An Agent Based Model is a simulation in which agents, that each follow simple rules, interact with one another and thus produce a often surprising outcome at the macro level. The purpose of an ABM is to explore mechanisms through which actions of the individual agents add up to a macro outcome, by varying the rules that agents have to follow or varying with whom the agent can interact (i.e. varying the network).

Implementing a new ABM will always require that person developing the ABM does some programming, but many tasks will be similar across ABMs. For example, in many ABMs the agents live on a square grid (like a chessboard), and can only interact with their neighbours. The abm_grid class contains a set of Mata functions that will do those task, and that someone can import in her or his own ABM.

This requies Stata version 15. The class itself is defined in the abm_grid.mata file. The class can be imported and used in an ABModel by adding the line do abm_grid.mata to the .do file that defines the ABM. There is a complete example of a simple ABM using abm_grid in the help files, start with help abm_grid. I will also give a talk on this at the upcoming German Stata Users' meeting on Friday May 24 in Munich.

I chose to use GitHub to distribute this class rather than SSC because this is a module that someone who is programming her or his own ABM might want to include in her or his ABM rather than a program ready for the end-user. Also I view this a collection of (potentially) useful functions, and I would like to encourage anyone who has something to add to that collection to do so.