Function Repository Resource:

SequentialCellularAutomaton

Source Notebook

Cellular automaton evolution with the order of each cell update specified

Contributed by: Stephen Wolfram

ResourceFunction["SequentialCellularAutomaton"][rule,init,list]

evolves using the specified cellular automaton rule from initial condition init, updating cells whose positions are specified in list.

ResourceFunction["SequentialCellularAutomaton"][rule,i]

is an operator form which updates only the cell at position i according to the rule.

Details and Options

ResourceFunction["SequentialCellularAutomaton"] currently works only for 1D cellular automata
SequentialCellularAutomaton assumes periodic boundary conditions.

Examples

Basic Examples (3) 

Compute the evolution of sequential rule 60, successively scanning from left to right:

In[1]:=
ArrayPlot[
 Downsample[
  ResourceFunction["SequentialCellularAutomaton"][60, CenterArray[{1}, 20], Flatten[Table[Range[20], 50]]], {20, 1}]]
Out[1]=

Update the cell at position 3 according to rule 0:

In[2]:=
ResourceFunction["SequentialCellularAutomaton"][0, 3][{1, 1, 1, 1, 1}]
Out[2]=

Make a rule plot of the substitutions in the sequential cellular automaton:

In[3]:=
RulePlot[ResourceFunction["SequentialCellularAutomaton"][30]]
Out[3]=

Scope (1) 

Use a totalistic 3-color cellular automaton:

In[4]:=
ArrayPlot[
 Downsample[
  ResourceFunction["SequentialCellularAutomaton"][{1635, {3, 1}}, RandomInteger[2, 20], Flatten[Table[Range[20], 20]]], {20, 1}]]
Out[4]=

Applications (1) 

Run sequential rule 60 with a variety of updating orders:

In[5]:=
GraphicsRow[
 ArrayPlot[
    Downsample[
     ResourceFunction["SequentialCellularAutomaton"][60, CenterArray[{1}, 20], #], {20, 1}]] & /@ {Flatten[
    Table[Range[20], 50]], Flatten[Table[Join[Range[20], Reverse[Range[20]]], 25]], Flatten[Table[ResourceFunction["InShuffle"][Range[20]], 50]], Flatten[Table[ResourceFunction["OutShuffle"][Range[20]], 50]], RandomInteger[{1, 20}, 20*50]}]
Out[5]=

Version History

  • 1.0.0 – 18 March 2020

Related Resources

Author Notes

This should be extended to other CA rule cases, as well as to higher-dimensional CAs, etc.

License Information