# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Compute the evolution of a mobile automaton with nonlocal rules

Contributed by:
Akshaj Devireddy

ResourceFunction["MobileAutomatonNonlocal"][ generates a list representing the evolution of the mobile automaton that measures the dependent cell indices | |

ResourceFunction["MobileAutomatonNonlocal"][ gives the result of evolving | |

ResourceFunction["MobileAutomatonNonlocal"][ is an operator form of ResourceFunction["MobileAutomatonNonlocal"] that corresponds to one step of evolution given a specified |

The state for a mobile automaton is given in the form {{*a*_{1},*a*_{2},…}, *n*}, where the *a*_{i} are values of cells and *n* is the position of the active cell.

The rules for a basic mobile automaton with nonlocal rules are given as a list of elements of the form {*a*_{-x},*a*_{0},*a*_{+x}}→{*ap*,*dn*}, where *a*_{-x} and *a*_{+x} are the dependent cell positions relative to the active cell, * ap* is the new value of the active cell, and *dn* is its displacement.

Basic dependent cell positions are listed as {*-x*, 0, *y*}, where *-x* is the dependent cell position *x *cells to the left, *y *is the dependent cell position *y *cells to the right, and 0 represents the active cell position.

Other ways to express dependent cell positions are listed as {*x*_{i},*x*_{i+1}... *x*_{k-1}*,**x*_{k}}, where you can input multiple dependent cells rather than just 3.

The rules for a block mobile automaton with nonlocal rules are given as a list of elements of the form {*a*_{-x},*a*_{0},*a*_{+x}}→{{*ap*_{-x},*ap*_{0},*ap*_{+x}},*dn*}, where *a*_{-x} and *a*_{+x} are the dependent cell positions relative to the active cell, *ap*_{i} are the new values for the block of cells and *dn* is the displacement of the active cell.

The rules for a generalized mobile automaton with nonlocal rules are given as a list of elements of the form {*a*_{-x},*a*_{0},*a*_{+x}}→{*ap*,{*dn*_{-1},*dn*_{0},*dn*_{+1}}}, where *a*_{-x} and *a*_{+x} are the dependent cell positions relative to the active cell, *ap* is the new value of the active cell and the *dn*_{i} are the new relative positions of the active cells.

The rules for a basic mobile automaton with non-local rules can be given as a pair of integers, in which case they will be decoded as specified in *A New Kind of Science*, page 887.

If the position of the active cell would be outside the range defined by the list of cells given, it is taken to be None.

ResourceFunction["MobileAutomatonNonlocal"][*rule*,*init**,**positions**,**tsspec*] supports the following time specifications *tspec*:

t | all steps 0 through t |

{{t}} | step t alone |

{t_{1},t_{2}} | steps t_{1} through t_{2} |

{t_{1},t_{2},dt} | steps t_{1},t_{1}+dt,… |

Five steps in the evolution of a mobile automaton with dependent cells 3 cells away on either side:

In[1]:= |

Out[1]= |

Visualize 40 steps of evolution of the mobile automaton with non-local rules scanning 3 cells away to either side of the active cell:

In[2]:= |

Out[2]= |

Use rule numbers to specify a mobile automaton rule:

In[3]:= |

Out[3]= |

Visualize the evolution using the resource function MobileAutomatonPlot:

In[4]:= |

Out[4]= |

Show only the tenth step of an evolution:

In[5]:= |

Out[5]= |

Show all steps from the fourth to the tenth, in steps of two:

In[6]:= |

Out[6]= |

When the dependent cell positions are specified as {-1, 0, 1}, MobileAutomatonNonLocal emulates MobileAutomaton because the dependent cells are its immediate neighbors:

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

When the active cell goes out of the defined region its position is given as None:

In[9]:= |

Out[9]= |

We have rules that create more than one active cell here. We are testing same rules with different ranges of dependent cells:

In[10]:= |

Out[10]= |

Plotting number of active cells over time for each of the mobile automata above:

In[11]:= |

Out[12]= |

Plotting mobile automata with 4 dependent cells positioned 3 cells to the left, 1 cell to the left, the active cell itself, and 2 cells to the right:

In[13]:= |

Out[13]= |

Wolfram Language 13.0 (December 2021) or above

- 1.0.0 – 15 July 2024

This work is licensed under a Creative Commons Attribution 4.0 International License