CA / Netlogo


In this practical we'll show you a small CA system for Excel, and you'll get to have a go at building a Netlogo model.

First, just because it exists and you might like to see it, here's a version of the Game of Life you can play with...

Download this Excel Spreadsheet. This implements the Game of Life in Excel, using Visual Basic for Applications. You'll need to "enable content" as you open the spreadsheet (just under the "ribbon"). Have a play with it to see the variety of behaviour that it is capable of.

If you want to see the code, you may need to add the developer's tab (File -> Options -> Customize Ribbon -> Under "Customize the Ribbon and under Main Tabs" enable the tab). The code can then be see under "Visual Basic". Understanding the code itself isn't so important (though if you're used to VBA, great). Essentially the key to making a CA is just a nested set of loops through a 2D array, but you need to remember to keep two copies of the array - one to look at for the current states and another to alter to the new states (the latter is then copied over the former at the end of each iteration through the whole array). If you do the alterations on the state-storing array, early cells are changed before later cells have had a chance to find out what their neighbours' states were.

Now, on to the main bit for today: a Netlogo model.

First, you'll need to download NetLogo. Go to the Netlogo website and download it. You should be able to install it to your M: drive space. Once you've done this, open up this introductory Word doc, and work through it: Netlogo.docx. This will walk you through your first model. At the end you can also have a look at this Advanced Version. Once you've got the idea of it, try looking at the examples that come with Netlogo and the online documentation, and write yourself a little model. How about trying to write the "planning for drunks" project from the first semester course, but with just one drunk and house to find?

(Here's my version - no peeking 'til you've tried it yourself!)

In addition, you might like to try out these practicals by Nick Malleson and Alison Heppenstall, associated with our Level 3 course GIS, Geocomputation and Geoplanning.