By default, initial conditions specified to CellularAutomaton
are cyclic:
I know that if I add a background, then I avoided the cyclicity, but the automaton then extends beyond the size of the initial condition:
Is there a way to get a cellular automaton that neither wraps around, nor extends beyond the initial range (by taking values outside of the initial range to always keep the background value)? This is different than allowing the automaton to extend and then cut off back to the initial region. Consider the following example:
There, I'd like the automaton to stay inside the first three cells, so that the successive states would be {0,1,0}, {1,1,1}, {1, 0, 1}, {1, 1, 1}, {1, 0, 1}
...
I know that I could achieve this, in principle, by adding a third color, setting the background to that third color, and create a rule that 1. counts the third color as zero, 2. never changes the third color into anything else. But because the software counts the colors as {0,1,2...}, if I wanted to encode the rule using a totalistic rule number, a background cell would count as 2 alive cells. So I'd need to handwrite my own cellular automaton map... but then what's the point in using CellularAutomaton
to being with. I'd like to avoid this hack.