Where can I find documentation of the rule number convention for CellularAutomaton
for higher than 1 dimension?
I understand the convention for elementary 1D automata, but I don't understand even why Conway's Game of Life is 224 am not certain how to calculate the number (even if the number is very big) for, say, a certain 7-state 2D automaton that depends only on a weird neighborhood.
Edit:
I think I understand how the rule for Conway's Game of Life works now. For reference, it's {224,{2,{{2,2,2},{2,1,2},{2,2,2}}},{1,1}}
. The form for the rule is {n,{k,{wt 1,wt 2,...},rspec} (where by documentation's convention, rspec means {r 1,r 2,...}).
In this case, we have the rspec as {1,1}
which means that each cell depends on the (2*1+1)x(2*1+1) neighborhood of it (the standard 3x3 box). The lone {2,{{
tells us that there are two states, which are implicitly 0
and 1
.
The matrix {{2,2,2},{2,1,2},{2,2,2}}
tells us how each cell in the neighborhood is weighted: if the center cell is state 1
it adds 1*1=1 to the total, and if a surrounding cell is state 1
it adds 1*2=2 to the total.
Luckily, the new state depends only on this weighted total: If there are two surrounding 1
s and the center is 1
, the total is 5, which means survive. If there are three surrounding 1
s and the center is 0
, the total is 6, which means birth. If there are three surrounding 1
s and the center is 1
, the total is 7, which means survive. If the total is 4, there are two surrounding 1
s and the center is 0
then the center stays dead. If the total is more than 7 or less than 4, there are more than three or less than two surrounding 1
s, and that means the center cell will become dead (state 0
).
Therefore, for all possible totals between 0 and 8*2+1=17, the new states are 0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0. Since 0 will always be the least possible total, it's a nice convention to reverse this list and treat it as the binary number 000000000011100000, which in base 10 happens to be 224.
I would still like to know for sure how this generalizes to more states (higher base?), and how this is calculated for "neighbors at specified offsets".