Squirm3 > development


Squirm3 Development Page

If you are a programmer and interested in Squirm3 then this is the place to be. Here you can get all the source code and look at some of the development history. I'd love people to get involved in the project to show the power of artificial chemistries so any help is appreciated.


Many of the pages have their own code available - here for example. The way I compiled and ran the code was by using Sun's JDK 1.3.1 and the simple command javac *.java. With later versions of the JDK this procedure might be different, also the applets produced don't seem to work in every browser. So you must experiment I'm afraid, if you know how to make an applet that works on ANY browser then I would like to know!

One known problem is with the forms on Mozilla. I have been told that Mozilla doesn't support Javascript very well (which is a shame) and since I use Javascript to pass the form contents to the applet the forms don't work. I guess I'd have to put buttons inside the applet? Life is too short, you might have to change browsers to use the applets fully.

Experimental versions of the applet code go back to August 2001, when some ideas were being tried out. Most of these pages have their own copies of the java code, with minor differences. Follow the links through the variants.

Some more versions are here for you to play with. If you have any ideas (any ideas at all!) for what else to try I will see what can be done. If you make versions yourself I can put them here if you want.

  • We thought hexagonal grids might be fun to try. Also this version uses a 3-neighbourhood for the reactions, which works reasonably well, and has more possibilities for catalytic action. www page, squirmhex.zip (14k) (20th Sept 2002)
  • And what fun we can have. With just two 3-nhood reactions we can make this happen: www page, worms.zip (14k) (20th Sept 2002)
  • Since we keep saying that the same chemistry would work with different physics, it was only right that we should try it. The code from CellLife was hacked into a form where it might be used to implement Squirm3 in a continuous 2D world with atoms as spheres. The bond strength is quite low to allow single atoms to occasionally pass through the membranes. www page, Squirm2d.zip (8k) (4th Nov 2002)


There is a C++ implementation, it runs a lot faster than a java applet. Presumably it could run a lot faster still, if you can improve it then get in touch and everyone can benefit. It is written for Microsoft Visual C++ 6 but the classes that do the work could be ported quite easily.

  • An implementation of variant 9 where replications occur within a membrane that grows and splits correctly. It is lots of fun for sure! source (64k) and exe (312k) (16th Sept 2002).
  • Going to a 3-neighbourhood gives more possibilities for catalysis. Here is a c++ implementation of 3-nhood reactions on a square grid. Edit the file reactions.txt to specify the reactions. I know this is lacking in explanation, email me if you want more. sq3nhood.zip (14k) (22nd Oct 2002)
  • For ECAL2003 we divided the world into three zones and ensured that different chemical environments prevailed in each. With some mixing between the zones we found that we could get the replicators to adapt to the different environments, which was quite nice to see. Here is the source code: sq3ecal_src.zip (73KB) and the exe: sq3ecal.exe (35KB). Refer to the paper (194KB) for details on what is happening. (5th June 2003)
  • Having gradually been drawn to the conclusion that membranes are essential if any growth of complexity is to occur, we need to find a way of creating the kind of membrane we want. In nature there are bilipd membranes that form and divide spontaneously, this would be nice to have. Naoaki Ono studied membranes in his PhD thesis (ps.gz (2.5MB). I've had a go at reimplementing some of these ideas, to see if this style of membrane might be useful for our AC. This is good fun to watch, especially on a quick machine. And quite relaxing really. [source (48KB)][exe (48KB)][screenshot (62KB)] Oh, and with slightly different rules you can get phase separation happening (this is actually easier): [exe (48KB)] (24th July 2003)
  • The nice thing about membranes is that the gene-string inside can produce enzymes and keep them to itself, which looks like being crucial to the evolution of complexity in chemical systems. But getting such a system to encode the enzymes it needs to trigger all the reactions it needs to copy itself is tricky. In this experiment I've encoded all the required 38 reactions. The molecule is the sprightly 710-base sequence ebccbababbaaacaadd bacaabcbcbbcbbcaadd bbbbabcaabcacbacdd babbcbcccccbbbbbdd cbcbcacabbaacabadd ccaacaccbcccbbadd bcbbcbcbbababaabdd bcbbcbcbbabacacadd bcbbcbcbbabbabacdd bcbbcbcbbabbbbcbdd bcbbcbcbbabcacccdd bcacacababcccabbdd baccbccccbcccbbaadd bacaccbccbacaaabdd babaccaaccaaabbbbdd ccccbaaabccbaaaadd bbbbbaaabccaccbdd bcbbccbcbbccaabccdd cabacabacabbbbcbadd bccacbcaaabcccccadd cbabacaaccccbbcbadd bccacbbbcccacccdd caababccbbcaccbbbdd bbbbcbcbcacabcbdd bcbccabcacbbbbcaadd bbacaaaabaabcaabcdd bcbaabcbcccaababcdd cbacbaaccabbacbbadd ccbcacccabcccaaaadd caabbaccbbbbcabbcdd cccbcbcbcaaaacabcdd baabcbbbcabbcccaaadd baacaaabcacbbaacbcdd baabccbbcbaaabcaabdd baacccabbcaacaaaccdd babbaaccabbbaacaccdd babaabcbbbcbbccaacdd babbacbbbababcacbcddf. Already the cell is rather big, and the enzymes take ages to bump into the reactants, making replication very slow. Maybe on a supercomputer this would work, for mere mortals it's a bit useless. Use the Run command on the Actions menu to start the simulation. The enzymes are supplied at the beginning since the cell needs them in order to be able to produce more and replicate itself. [exe (56KB)] (7th May 2004) Update: I ran this for 60 hours over the weekend, it got as far as duplicating 6 bases. At that rate I estimate it would take over two years running flat out to copy itself completely. Either we don't ask the cell to control all its own reactions, or we look for a different approach.
  • But the continuous-space membrane model is still attractive. By tweaking the range and strength of the repulsive forces as below I can stop the membranes sticking to each other in multiple layers. By introducing catalysts that gradually produce membrane particles I can get the behaviour we want: the 'cells' first elongate, then separate into multiple cells. Sometimes it is quite messy but hopefully what's going on is reasonably reproducible. The simulation starts with the initial conditions preset. The water particles are in light blue, around the outside. The oil-like particles are in dark blue, while the hydrophobic and hydrophilic particles are in red and yellow respectively. The catalysts are in green. Initially all the non-water particles are hydrophobic, and so the oil bubble stays in the centre and doesn't mix with the water. Hit 'Run' off the 'Actions' menu to start the simulation. After relaxing into an energy-minimising state, the catalysts start producing membrane particle-pairs, when a red and a yellow bump into the catalyst. These naturally congregate at the boundary of the oil-like things and the water. As more are produced the ratio of perimeter to area increases, causing the cells to elongate and curve. As more still are produced the cells divide. The cell that 'inherits' a catalyst may continue the process. Cool, no? [exe (48KB)] (18th Oct 2004)