Modern Cellular Automata Author Documentation

Modern CA Entrance / Author / AuthorXY / Revisions

Installation

Download the Modern Cellular Automata software distribution (under 40K) and unzip the archive files into a local directory on your computer. You should then be able to run Author by double clicking on the author.html icon. A copy of the Modern Cellular Automata applet should be placed into directories which contain HTML files which use the applet.

Synchronized applets

Multiple Modern Cellular Automata applets on a page can be synchronized with each other. Synchronization provides the following capabilities:
  • advance/reset in lockstep
  • shared state to color mappings
  • shared random initial configurations
  • shared ancestors for mutated rules.
  • A group of synchronized applets always has a single "master" applet which is in control of all advancing and resetting. All of the other applets are "slave" applets to this master.

    Applet parameters

    Using numeric range parameters

    Parameters corresponding to maximum speed, reset generation, and reset interval may be specified as uniformly distributed numeric ranges. The Modern Cellular Automata applet chooses a value at random from the range during applet initialization. The format for a numeric range is low - high.

    Ca parameter

    Specifies the names of all synchronized slave applets. Names are blank delimited. Each of these applets must have the Slave parameter specified. This parameter should be omitted for non-synchronized or slave applets.

    Maximum Rate parameter

    Specifies the maximum rate in advances per second of the applet. A value of 0.0 results in a halted applet. A range of numeric values may be specified. Omitting the parameter results in the applet advancing at the maximum possible rate.

    Reset Bounds parameter

    Specifies the bounds which are used for randomization or placement of the reset formation. If a reset formation is used it is centered within these bounds. Format is left, top, width, height. Defaults to 0, 0, universeWidth, universeHeight.

    Most cells outside of the reset bounds are cleared to state zero. The border cells at the edges of the universe are set to a special invariant state value.

    Reset Formation parameter

    Specifies an initial formation to be centered within the reset bounds. If this parameter is not specified, then random initialization is instead performed.

    The reset formation consists of digits '0' through '8', corresponding to state numbers, and '.', which indicates the start of a new row. Game Of Life's familiar glider may be specified as 010.001.111.

    Author allows multi-line specification of a formation, and converts this specification to a single line for use by the applet. Author will only display the results of advancing the initial formation, and will never display the initial formation itself. This is easily demonstrated with Game Of Life's Blinker formation, specified as 111, with a maximum rate of 0.0.

    Reset Generation parameter

    Specifies a number of generations to advance after which the applet resets itself and all associated slave applets. A numeric range may be specified. An applet without a reset generation or a reset interval will run until clicked upon.

    Reset Interval parameter

    Specifies an interval in seconds after which the applet resets itself and all associated slave applets. A numeric range may be specified. An applet without a reset generation or a reset interval will run until clicked upon.

    Rule parameter

    Specifies the cellular automata rule to be used for the simulation. If no rule is specified Conway's Game of Life is assumed.

    The special value "master", when used by a synchronized slave applet, indicates that the applet is to run the master applet's rule as modified by the slave rule's mutation rate. When the slave applet is clicked upon the master applet's rule is replaced by the slave applet's current rule mutation, providing a common rule for use and mutation by all linked slave applets.

    Broadly speaking, rules may be specified in either basic or canonical format. Basic rule notation is based upon traditional "birth/survive" rule notation. The characters "a" to "e" are used to indicate the number of side neighbors in the rule. "a" corresponds to zero side neighbors, while "e" corresponds to four side neighbors. Here are the meaningful combinations of total and side counts:

         0a
         1ab
         2abc
         3abcd
         4abcde
         5bcde
         6cde
         7de
         8e
    

    Here is the full basic rule specification for Game Of Life:

         3abcd/2abc3abcd
    

    If a total count is specified without side counts it is equivalent to all meaningful side counts having been specified. Each of the following specifies Game Of Life:

         3abcd/2abc3
         3abcd/23abcd
         3abcd/23
         3/2abc3abcd
         3/2abc3
         3/23abcd
         3/23
    

    Basic rules with more than two states specify the number of states by appending the number of states to the rule, seperated by a comma. Up to nine states are supported. The following specifies Brian's Brain:

         2/, 3
    

    In the canonical rule format the number of states is inferred from the largest state number seen in the specification. For each state value in turn, result state values for each of the twenty five combinations of corner and side counts is given. Here's the portion of the canonical specification of Brian's Brain which specifies result state numbers which can arise from various combinations of neighbor count:

         00100.01000.10000.00000.00000
    
    For convenience canonical rules result states are typically grouped into groups of five. The group number indicates the number of directly adjacent neighbors and the position within the group indicates the number of diagonal neighbors. Here the result state is "1" for all combinations of adjacent and diagonal neighbor counts which total two. When less than twenty five result states are specified the last state value is assumed to repeat. The following are equivalent:
         00100.01000.10000.00000.00000
         00100.01000.10
    
    A particular state value may either contribute to its neighbor's counts or not, and this is specified by prepending either a "c" (for counting) or an "n" (for non-counting) to the canonical specification:
         n.00100.01000.10
    
    The special counting codes 'a' and 'd' are also available for use. Use of the 'a' code specifies that a cell with the given state contributes to counts of only adjacent neighbors. Use of the 'd' code specifies that a cell contributes to counts of distant neighbors only.

    Finally, the rule is specified state by state. Here's canonical Brian's Brain:

         n.00100.01000.10.c.2.n.0
    
    Here's Canonical Game Of Life:
         n.00010.00100.01000.10.c.00110.01100.11000.10
    

    Multiple step cellular automata rules combine either basic rules or canonical rules. They are specified by seperating individual steps with plus signs. The following specifies a five step version of Game Of Life with identical steps:

         3/23 + 3/23 + 3/23 + 3/23 + 3/23
    

    Repetition is indicated by use of an asterisk preceeded by a count. The following specification is equivalent to the previous specification:

         5 * 3/23
    
    One is a valid count, but zero is not.

    Parentheses may be used to group steps together. The following specification is equivalent to the previous two specifications:

         2 * (3/23 + 3/23) + 3/23
    
    Here's a nice two step Brain specification:
         2/ + 2/3, 3
    
    Here's the canonical equivalent of the two step Brain specification:
         n.00100.01000.10.c.2.n.0 +
         n.00100.01000.10.c.22212.22122.21222.12.n.0 
    

    Rule Mutation Rate parameter

    Specifies the rule mutation rate. Default value is 0.0.

    Rule mutation is accomplished by randomly substituting new result state values into an expanded canonical rule, where the rule expansion has no asterisks or parentheses. Mutation does not affect the number of states, the number of steps, or whether each state value contributes to counting or not.

    Slave parameter

    When specified indicates that the applet is to be synchronized with a master applet. The master applet should specify the slave applet's name as an entry in its Ca parameter.

    Universe Size parameter

    Specifies the size of the cellular automata universe. Format is width, height. The edges of the universe are always constant. Default value is 128, 128.

    Zoom parameter

    Specifies the integer magnification used to view cells. Default value is 2.