3.34 Cellular automata

Cellular automata were introduced by von Neumann and Ulam as simple models for self-reproduction. On an abstract level, the automata are the models of spatially distributed processes. They consist of an array of cells, each of which is allowed to be in one of a few states. Each cell looks to its neighbours and determine what state it should change to using a predefined simple rule.

To start simulation of a 2D cellular automata, one should first create an instance of the HCellular class. Once the instance is created, it should be easy to check the available methods as:

>>>from jhplot  import *
>> c=HCellular()
>> print c.getRules()
  [Aggregation, Aqua, AquaP2,
   BlockVN, Check24, Check29,
   Check35, Check25ByGA, CyclicCA8,
   CyclicCA14, VN, Life, Life2,
   Generation, GMBrain, Hodge,
   Ising, Stripe]
Learn about the rules using the documentation help by calling c.doc() How to access the rule class and the initial configuration? This can be done using the methods:

>>> print c.getRule()
>>> print c.getInitString()

One can change initial configuration with the setInitString(string). The most convenient way is to write a configuration to an external file. You can read the rules by looking at the API.