Search This Blog

17 June 2008

My favourite: Simulations

About four months ago, you may remember me saying this:

One-off spurts of fun and stuff are all very interesting, but maybe a little series of posts would be nice?

Now, approximately one third of a year later, I've finally managed to mop up enough creative juices to write the second part of the 'My favourite' series. Sorry for the long wait, but hopefully anyone out there with the same interests as me will agree with my choices.

A challenge often tackled by computer scientists is the imitation - or simulation - of various real-life phenomena. It's a subject that interests me, and so here I list some internet gems that I have found recently on the subject of simulation.

Boids

Flocking birds exhibit some of the most organised behaviour in the animal kingdom, and yet they have no leader. It turns out that each bird uses simple rules to coordinate themselves with their neighbours, leading to an overall consensus as to the direction and speed of the flock. In 1986, Craig Reynolds came up with an algorithm that imitated flocking behaviour using simple computerised creatures called Boids. The Boids program I have linked to in the title is not as fancy-looking as some of the others I have seen, but in my opinion it has a much cleaner feel and many more variables to twiddle with.

Note: If you have even a moderately good processor, the simulation will probably be running far too fast to watch properly. If you set 'Refresh delay in ms' to something higher, it should be easier on your eyes.

The Game of Life

Note: For a little background info on Conway's Game of Life, try the Wikipedia article linked to in the title, or my post on the subject.

In actual fact, the Game of Life doesn't really simulate anything very convincingly, but it is a very important concept in terms of semi-chaotic behaviour. Many different structures can be implemented using it, from simple patterns that cycle around indefinitely to more complex arrangements capable of creating other objects or even themselves. Even watching the results of a random arrangement of cells can be fascinating, as well as demonstrating Life's chaotic unwillingness to settle down. If you're really keen, there's even a Game of Life pattern for a Turing machine.

Gravitee

Despite actually being a game (and having a pretty cheesy title), Gravitee is a fairly convincing imitation of Newtonian gravity. Basically it's a golf game, but interplanetary, and when you hit the ball you find it obeys all the laws of physics you might reasonably expect it to. Obviously you would need billions of pounds in funding and a pretty hefty launcher to play this sort of game in real life, but otherwise the science is sound. Moreover, it's great fun to play.

I'm afraid you'll have to excuse me now while I play another round of Gravitee golf, but I'll be back soon. Tune in next time!

08 June 2008

Part Ten: It's all in the head

Later, when all the staff had dispersed reluctantly to their lessons, the headmaster had his usual patrol of the main building. It was mainly to distract him from the pressure of running the whole anarchic establishment that was the school, but it also gave him a chance to hunt down any skivers. The head was not greatly keen on blood sports, but he knew a skiver when he hit one. As he trudged along, he suddenly heard a loud crash from the other end of the corridor. He broke into a jog, gradually gaining speed until it became a run. Still the crashing continued, and it was getting louder by the second. The noise appeared to be coming from the janitor’s cupboard, known to be the favourite haunt of lesson-dodging pupils. Although it was called a cupboard, it also doubled up as the janitor’s miniature home from home and was considerably roomy. Coming to a halt outside the door, the headmaster rolled up his sleeve and prepared to enter. “Right then!” he bellowed as he strode through the door. “Who is responsible for…?” Suddenly the room seemed to sway around him. Colours swirled and faded, and there was a general feeling of warmth and fuzziness in the vicinity. Small fish flitted among huge purple trees on gossamer wings; two-tonne ducks dabbled upside down in a floating orange lake and with a sigh the head passed out on a bed of soft black mushrooms. Well, at least he wouldn’t have to go to the school council meeting.