ACML - automates cellulaires en caml

ACML is an implementation in an obscure language of a naive solution to one of the most common programming exercise: simulating cellular automata.


5 reasons NOT TO download the binary version

  1. your OS is not Linux
  2. architecture/library dependencies problems
  3. some features (load/save ACML source files) require an OCaml compiler on your system in the exactly same version as the one used to generate the binary
  4. source archive is a lighter download
  5. whos knows, I might become root on your machine...

Usage & Examples

Basic usage: launch and watch

To have an idea of what ACML can do, you can try these command lines (try one line at once):
acml --nogtk --run life
acml --nogtk --run bosco
acml --nogtk --run 54
acml --nogtk --run sandpile
acml -vx 200 -vy 500 -x 100 -y 250 --nogtk --run fire
acml --nogtk --run B3678/S34678
acml --nogtk --run --refresh_rate 100 langton
acml --nogtk --run majority --- neighborhood Moore states 5 radius 4

More interactive usage

Launching ACML without any command-line option give you an interface with many buttons. Try to click on buttons. See what happens. Try this:
acml cyclic
In this example, you can explore the family of cyclic cellular automata by adjusting parameters in the user interface.

A small program's worth a thousand clicks

The primary goal of ACML is to allow quick writing and testing of new automata rules. To achieve this the key features are:
  1. automtic compilation/dynlink process: you write the source in OCaml, click Open... (right toolbar) in the user interface, select your file and ACML do the rest.
  2. parameters: instead of a single rule, your source code can describe a whole family of rules depending on some parameters. Then, without changing the source code, you can adjust the parameters from the user interface and easily test all the rules in the family.
  3. everything is programmable: you are not only free to write new automata rules, but also new initial configurations, new ways to display the universe, new ways to measure quantities along time, new ways to interact with the mouse, etc. Moreover, all this comes with a simple plugin system which allows to factorize code.
  4. reproducibility: ACML can manage random seeds for you. If you use pseudo-randomness apropriately in your source files, you can generate and simulates as many rules on as many configurations as you want and just click Save when you're happy: a new source file is saved and opening it will reproduce exactly your last experiment.


Some help on how you can write your own cellular automata:



ACML should compile on any plateform where you can install these prerequisite (tested on Ubuntu Linux and Mac OSX).

Debian-based linux distributions

On Debian-based linux distributions (tested with Ubuntu 10.04 and 10.10), you should get all what you need with this single command-line:
sudo apt-get install ocaml ocaml-findlib libsdl-ocaml-dev liblablgtk2-ocaml-dev libcairo-ocaml-dev libzip-ocaml-dev

Other systems

If your OS has some kind of packaging system, you may find corresponding package names starting from the list above. Alternatively, you can use GODI (source code OCaml distribution). The following list of GODI packages should be sufficient:
godi-ocaml-all godi-findlib godi-lablgtk2 godi-ocamlsdl godi-cairo godi-zip
To install these packages, external libraries (e.g. SDL, GTK+2 and CAIRO) must be installed on your system (they are not provided by GODI). This installation method works on MacOS (tested on 10.6 and 10.4, using fink for external libraries).

Compilation instructions

In the src/ directory of the decompressed archive, type:
sudo make install
In case of a compilation failure, it might be necessary to do run make clean before another make.


In the directory src/builtin, you can add or remove as much ACML source files as you want. Each file can contain a family of cellular automata or a plugin. During the compilation, all these families or plugins are embedded in the binary.