BusyBoxes
BusyBoxes
Implementation of Busy Boxes 3D reversible cellular automata
Definition
Definition
In[]:=
Documentation
Documentation
Usage
Usage
BusyBoxes[init]
run BusyBoxes CA rule starting from an initial 3D state .
init
BusyBoxes[init,n]
run for steps.
n
BusyBoxes[init,-n]
run for steps in reverse.
n
BusyBoxes[init,n,phase]
specify an initial integer .
phase
Details & Options
Details & Options
▪
Busy Boxes (BBX) is an implementation of the 3D reversible cellular automata developed by Ed Fredkin and Daniel B. Miller in their 2005 paper, Two State, Reversible, Universal Cellular Automata In Three Dimensions. A preprint is available here.
▪
The rules of this Cellular Automata are as follows:
- Play takes place on a 3D Cartesian state of cells.
- Each cell in the state is either odd or even, depending on whether the sum of the three coordinates specifying that cell's location in the state is odd or even.
-Cells are either 1 or 0. 1 cells are shown as red if they are even, or blue if they are odd. 0 cells are not shown.
-There are six phases in the evolution of the CA, numbered 0 to 5. During even phases, only even cells are operated on. During odd phases, odd cells are operated on.
-During phase 0 and 3, the planar rule is applied to the XY plane. During phase 1 and 4, it is applied to the YZ plane. During phase 2 and 5, it is applied to the ZX plane.
-The planar rule is this: for each diagonally situated pair of cells on the plane, if a 1 exists at either of the pair's knight's move positions, the value of the two cells in that diagonal pair is swapped. However, this only happens if there is no conflicting swap for either cell.
-The knight's move positions for a diagonal pair of cells are the cells that can be reached from both cells in the pair by moving two in one axis and one in another. A picture helps:
- Play takes place on a 3D Cartesian state of cells.
- Each cell in the state is either odd or even, depending on whether the sum of the three coordinates specifying that cell's location in the state is odd or even.
-Cells are either 1 or 0. 1 cells are shown as red if they are even, or blue if they are odd. 0 cells are not shown.
-There are six phases in the evolution of the CA, numbered 0 to 5. During even phases, only even cells are operated on. During odd phases, odd cells are operated on.
-During phase 0 and 3, the planar rule is applied to the XY plane. During phase 1 and 4, it is applied to the YZ plane. During phase 2 and 5, it is applied to the ZX plane.
-The planar rule is this: for each diagonally situated pair of cells on the plane, if a 1 exists at either of the pair's knight's move positions, the value of the two cells in that diagonal pair is swapped. However, this only happens if there is no conflicting swap for either cell.
-The knight's move positions for a diagonal pair of cells are the cells that can be reached from both cells in the pair by moving two in one axis and one in another. A picture helps:
Out[]=
X | 0 | 0 | 0 |
0 | 0 | * | 0 |
0 | * | 0 | 0 |
0 | 0 | 0 | X |
0 | 0 | 0 | X |
0 | * | 0 | 0 |
0 | 0 | * | 0 |
X | 0 | 0 | 0 |
-The X's are the knight's move positions for the pairs of cells represented by asterisks.
-In this bounded implementation, swaps are not allowed with cells outside the boundary.
Note that since only swaps are allowed, the number of 1's and 0's is fixed for any set of initial conditions. One may think of the BBX CA as a set of rules for moving 1's around on the state.
-In this bounded implementation, swaps are not allowed with cells outside the boundary.
Note that since only swaps are allowed, the number of 1's and 0's is fixed for any set of initial conditions. One may think of the BBX CA as a set of rules for moving 1's around on the state.
Examples
Examples
Basic Examples
Basic Examples
Run starting from a random initial condition for a single step:
BusyBoxes
In[]:=
BusyBoxes[RandomInteger[1,{6,6,6}]]
Out[]=
SparseArray
———
Run for 3 steps and visualize it:
BusyBoxes
In[]:=
ShowBusyBoxes[state_, OptionsPattern[{"Grid" -> True}]] := Block[{positions, dx, dy, dz, cz}, positions = SparseArray[state]["ExplicitPositions"]; {dx, dy, dz} = Dimensions[state]; cz = Quotient[dz, 2] - 1; Graphics3D[ If[ TrueQ[OptionValue["Grid"]], Table[Line[{{x, 0, cz}, {x, dy, cz}}], {x, 0, dx}], Table[Line[{{0, y, cz}, {dx, y, cz}}], {y, 0, dy}] , Nothing ], {If[EvenQ[Total[#]], Red, Blue], Cuboid[# - 1]} & /@ positions , PlotRange -> {{0, dx}, {0, dy}, {0, dz}} ]]
In[]:=
ShowBusyBoxes/@BusyBoxes[RandomChoice[{.9,.1}->{0,1},{6,6,6}],3]
Out[]=
,
,
,
———
Run BBX for 100 steps and 100 more in reverse:
In[]:=
ListAnimate[ShowBusyBoxes/@(Join[#,BusyBoxes[Last[#],-100]]&@BusyBoxes[SparseArray[{{7,4,4}->1,{5,5,4}->1,{7,3,6}->1},{10,10,10}],100]),SaveDefinitions->True]
Out[]=
Scope
Scope
Options
Options
Applications
Applications
Properties and Relations
Properties and Relations
Possible Issues
Possible Issues
Neat Examples
Neat Examples
Gliders:
Source & Additional Information
Source & Additional Information
Nikolay Murzin
◼
CA
◼
BBX
◼
BusyBoxes
◼
SALT
Categories
Categories
◼
CellularAutomaton
◼
ArrayPlot3D
◼
Raster3D
◼
SparseArray
◼
SubmatrixReplace
◼
BlockCellularAutomaton
Miller, Daniel B., and Edward Fredkin. "Two-state, reversible, universal cellular automata in three dimensions." Proceedings of the 2nd conference on Computing frontiers. 2005.
13.0+
Additional information about limitations, issues, etc.
Additional information for the reviewer.