Skip to content

Artificial Life in your Web Browser!

August 29, 2011

I’ve made a YouTube blog post about artificial intelligence before, it’s been a long-time interest of mine. In that post, I believe I mentioned an artificial life simulation program I’d written. It’s a simulated 2D world in which little “ants” live. The ants are controlled by randomly connected neural network, and they can choose an action at every time step, such as turning left or right, moving forward, eating food, drinking water, or reproducing.

The ants need both food and water to gain energy and survive. They can choose to spend some of that energy to create a baby (another ant with a mutated version of the parent’s brain). The interesting thing is that although the ants are initially very dumb, they eventually evolve to seek food and reproduce on their own. There is nothing forcing them to do either of those things, but only the ants that succeed at it can stay alive. I think this has some interesting philosophical implications about real-world lifeforms. It’s also, perhaps, an interesting “proof” that natural selection really works (you can see it happen right before your eyes!).

Anyways. I ported the said program in JavaScript, and you can run it in a web browser. If you’re interested in trying it, click this link. You can click “fast mode” to let the simulation run as fast as possible. You can then later click “real-time” to slow it down and observe the behavior of individual ants. I recommend running this in the latest Google Chrome as other browsers may be too slow.

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: