Cellular Automata in SVG
Instructions
Cellular Automata game simulates evolution of a one-dimensional population of cells.Simple rules of the cellular community govern cellular multiplication and evolution.
Up to three consecutive neighbors in one generation may give birth to a cell in the next generation.
There are exactly eight different configurations of neighbors: some of which lead to a new life, some are infertile.
You can change fertility rules via control panel in the upper left corner.
You can also view/edit binary representation of the fertility rule in the text box to the right of the control panel.
Examples:
- Growing patterns: 50, 99, 109
- Nested symmetrical growing patterns: 22, 60
- Random patterns: 30, 45, 73
- Variable pattern growth rate: 225
- Mixture of regular and irregular: 110
Notes:
February 13, 2006. Original implementation of SVG cellular automata used svg:rect elements to represent cells. This approach is quite effective but quickly drains system resources. Resetting generated patterns can hang the browser when more than approximately 50,000 cells were generated.
March 7 2006. Busted performance with "lines" method
Kevin Lindsey suggested using thick lines and dash array to represent a bitmap of cells.
This way a row of cells is represented as one line element instead of a set of rects.
This led to approximately five-times increase in performance.
You can switch between the algorithms by choosing lines or rects radio boxes in the top right corner.
March 15 2006. SVG Cellular Automata works in Firefox
Kam-Hung Soh pointed out that SVG Cellular Automata does not work in Firefox.
A few changes to JavaScript enabled the game in Firefox. Main changes are:
- getTarget()=>target
- getData()=>data
- setData()=>data
- getFirstChild()=>firstChild
- svgDocument must be defined.
<line/> seam to ignore dash array, so "lines" method does not work in FF 1.5 yet.
March 17 2006. SVG Cellular Automata is fully functional in Firefox
Thanks to Michael's suggestions, all issues in FF are fixed now.
Aslo CSS had to be modified.

