Assignment 6 - due Monday, November 8, midnight, by email

Please do work on your own - no group work. If you are stuck, contact me. Collaborating on this assignment will be viewed as cheating.

Important Note

I want you to email me your assignment this week. You can either zip together a set of files, or send them separately. My address: fickas@cs.uoregon.edu.

Problem 1

I had a student request for this chapter, and since it was on my list, I decided now was a fine time to look at it. You first need to read chapter 44 in Dewdney.

Note that the notion of cellular automata was thought up by John vonNeuman (von noy man). This is the very same fellow who is next to Alan Turing on the side of our building. So now you have links to both CS pioneers through your homework.

vonNeuman was interested in self-replicating computers. I suspect he would have liked movies like the Matrix. This idea that computers can build other computers is still a popular one. There are two angles: (1) computer hardware that can reproduce computer hardware, and (2) computer software that can reproduce computer software. Hard to say what cellular automata is best suited for. You can almost believe that some of the patterns could represent circuit diagrams like the logic gates we have been drawing. Kind of interesting.

Part a. Download the game of life. You can find Windows and Mac versions here: http://www.bitstorm.org/gameoflife/standalone/GameOfLife-1.5-installer.exe. Now set the starting point as follows:

OOO-O-OOO O---O-O-- O---O-OOO O---O---O OOO-O-OOO where the O signifies a marked square. This should spell out CIS. Run it and tell me what happens. Note that you will need this description when you attempting to test your code from problem 2 below.

Part b. One use for cellular automata is in modeling the environment, e.g., weather patterns. Construct some configuration of weather and then run it and tell me what happens.

You may ask what your configuration should look like. Use your imagination. What I would come up with, which is kind of mundane, is Doppler radar patterns taken from the web. Here is one such map: www.weather.com. What would be interesting (and spooky) is if you could morph this map into a map that actually was weather seen in the future! Why would this be spooky? Because the GameOfLife rules are not weather rules. Meteorologists have their own set of rules for the cellular automata they use. In essence, they attempt to write rules that will morph observed patterns day by day.

Here are some existing patterns that might inspire you in building your weather pattern: Game of Life lexicon.

Turn-in: For part a, need a text description. For part b, you need to save your weather pattern to a file and then email me that file. I will run it on my computer. Include a short description of what your weather pattern morphed in to.

Problem 2

Like to do some more Java programming. As you can see, chapter 44 has a pseudo-code algorithm for the game of life (page 297).

I will give you part 2 of the code, the two for-loops that refresh and display the cells. Your job is to write part 1. Here is the skeleton: gameoflife. Note that this is a folder with two java files in it. Download the entire folder and store on your computer. Then work on the GameOfLife.java file within that folder. Note that this file will compile and run as is. But is does nothing other than show CIS on the screen, forever. You need to add the part 1 code that makes CIS change into different configurations.

As you can see in the skeleton I give you, there needs to be an infinite while-loop that surrounds the whole thing. Dewdney mentions this in the chapter, but then fails to add it to his code. Go figure.

There is something new in this code that we really cannot avoid: we need to be able to work with a matrix that represents the cells. The general Java format for a matrix called L is L[i][j]. Dewdney represents this as L(i,j). So where you see the matrices L and X in the code on page 297, you will need to do this translation. You can also see it in the part 2 code I give you.

To make sure your code is working, you start with CIS in the cells. I did this so you can test your code. Your code should give same result as in problem 1.a.

Turn-in: just send me the GameOfLife.java file. I'll compile and run it to make sure it works.