Topics › Simulation

Solar system simulation

[UPDATE: I've made a 3D version of this simulation using the Khan Academy programming environment.]

Macrophage chemotaxis

I updated my macrophage simulation to use my Python particle module, which I describe here. I was pleased how straight forward it was to effectively re-create my previous simulation from scratch using a few simple commands. There are a few changes I'd like to make so creating new simulations will be even quicker in future.


Science Simulation

Various simulations of experimental techniques that I hope to use on simulated cells. I'd like to combine them with a virtual lab book to make a game.


Pygame physics simulation (Tutorial)

A tutorial explaining how to use the Python module, Pygame, and some basic trigonometry to create a physics simulation.

Molecular dynamics simulation

I wanted to write about a Java molecular simulation that I made a while ago, before I became entranced by Python. The program is a simple 2D physics simulation, with circles representing billiard ball-style atoms. The idea before the simulation was initially an attempt to create a virtual lava lamp. In its first incarnation, there were two types of atom. Each atom was attracted to nearby atoms of the same type (with a force proportional one over distance squared). If the distance between any two atoms was below a threshold then the two atoms repel each other.

Simulating tribal island economies

I’ve just started reading Gun, Germs and Steel by Jared Diamond, and was particularly interested by the description of how various Polynesian islands developed. As with pretty much everything these days, I wondered how I could simulate such a situation, perhaps making a game out of it (there must be a computer game that is based on this time and place – something like The Settlers).

Evolving ant behaviour

Example of simple ant behaviour - spiralling

I've been thinking for a while about how to program ant behaviour in my simulation. The difficulty is that even relatively simple behaviours (such as following a pheromone trail) are difficult to code as a behaviour at the agent (or ant) level. While I probably could come with a reasonable behaviour if I thought about it and tested various parameters, it seems a lot simpler to evolve a suitable behaviour. After all, that’s what ants did.

Starting an ant colony

The ants move randomly, leaving a trail of pheromones.

I have started to remake a simulation of an ant colony that I once made in QBASIC. The idea (which I am by no measure, the first to contemplate) is to create an ant colony that can harvest surrounding food (seeds or leaves – the green ovals in the picture) in an intelligent manner, despite the individual ants having very limited intelligence or information to work with.

Macrophage simulation

While discussing some of my programming projects in the pub, I mentioned using biological approaches to creating a Artificial Intelligence to play Go. I was initially thinking of evolving solutions, but the conversation gradually moved into a biological analogy for Go: two teams of macrophages, one black, one white, trying to engulf one another.