Life Simulation

This is a simulation of cellular automata I've built using Processing. It is my own code based on the standard life rules with minor modifications. I have built a life sim in C++ for a console window before and took that very basic, text-based output algorithm and visaually expanded it here.

If you don't have java installed, you'll see an error message. in the box below. Otherwise, go ahead: click and drag in the black box below to get the simulation going! (Speed may vary based on your computer.)

To view this content, you need to install Java from java.com

Refresh this page to reset the simulation.

When the you click in the simulation area, you are seeding individual cells with life, just like a scientist might drop cells into an agar-filled petri dish. The simulation is constantly active, like real life, so there's no "start going" button or anything; as soon as you add life to the sim, the cells start living on their own. Each pixel on the screen represents a cell, and the edges of the screen are solid, like a dish. (Not continuous/connected, like the edges of a pac-man screen.)

The sim follows the basic rules of life in that the number of neighbors determines the state of a particular cell and that cells may spontaneously live or die based on the neighbor rules. I have deviated in the rule set up in this sim by allowing cells with 1, 2, 3, or 4 neighbors to live. The classic rules dictate that a cell with 4 neighbors would die, but I have chosen to allow that cell to live to add a fourth color in the display of density.

Visually, the colors on the screen represent local cell density, changing cell color based on the number of neighboring cells around the cell. High density to low density: white, orange, red, blue.

In future developments, I think I might rework the density display to be a more general calculation with greater color vairation, instead of the current local calculation. I am also working with some of the user interaction elements in the processing example library to theorize new means of user interaction with my sim.

Take a look at my source code here. (Very much like C or ActionScript, only processing is not object-oriented. The similarity is even more apparent because I format my code like C and not in processing's native format. But processing doesn't care about formatting so long as syntax is correct. SO I've working in my own style for comfort here.)


Copyright © 2010 | B. Steiner
britsteiner@gmail.com | updated: 2/6/2010

Portfolio Main Code Widgets Artwork Academic Writing Multimedia