Cogitech IncMiscellaneous | About us | Training | Tabular Topic Maps | Cogitative Topic Map Websites | Semantic Web Glasses | XWATL
Cogitative Technologies>Miscellaneous

Secure SSL Certificates.

Cellular Automata in SVG


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.
Try changing these patterns and press "Fetch" button to see how a one-dimensional binary world will evolve under your fertility rules.
Rules can be set by clicking on the controls, typing rule number in the text box on the top, or by selecting an examples below.
  • 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
By default, we set fetch size to 25 generations at a time, but it might be a good idea to start with a larger number of generations, say 200; just be patient - this is processor intensive.


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.
onkeypress event does not fire in FF 1.5 , so one has to click links in the examples above;
<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.

Cellular Automata is described in A New Kind of Science by Stephen Wolfram .

Budget Web Hosting and Cheap Domain Name Registration

Cogitech Inc. Made with Bexcelor & Tabular Topic Maps