April 19, 2004

Well, looks like my ankle wasn't so bad after all. Managed to limp to uni, and after a few hours, developed a gait that took the pressure off it. I needed to turn my ankle ~20 degrees west on the down stride, which kinda made me look retarded... Just as well table tennis doesn't start again until next Monday :-)

Any who, I fell for one of the most common mistake in programming: seeing the trees not the forest (now if the damn trees would MOVE, then I can see the forest). Started doing this very clever vector class for handling ocean currents, then realized all I needed to do really was employ the branch of mathematics I dislike the most: statistics. Haven't managed to actually take ocean currents into account yet, but the ocean.SpreadSeed() function works.

Here are some screen shots of it in action:

1st period
[What it looks like after the first breeding period]

3rd period
[Mid way through the simulation, 3rd breeding period]

5th period
[Almost at the end, 5th breeding period.]

I stop it there and then because it was getting out of hand. Ideally the number of coral are kept in check by the starfish, but since that has not yet been fully implmented, the problem of expoential rise in calculations is experienced. This is somewhat headed off by restricting the reproductive age of coral to under 1000 days for testing purposes. This might be a problem, although the population over all should be a constant once the simulation is properly balanced.

To Victor/Team, sorry, but the Organism interface has been changed again. Its not much, so what ever algorithms you might have came up with should still work 100%. Please take note and integrate, or send me what you have, and I'll do it.

Also implemented the Plankton class to provide extra food. Please make sure corals get energy from sunlight, ocean, and plankton. Ocean currents will be implemented ASAP.

The code has grown somewhat. Below is the class usage diagram and the current line counts:
steve@Geofront::~>wc -l /share/tmp/*

183 /share/tmp/Coral.java
17 /share/tmp/Environment.java
201 /share/tmp/GridDisplay.java
208 /share/tmp/GridPanel.java
348 /share/tmp/Ocean.java
57 /share/tmp/Organism.java
124 /share/tmp/Plankton.java
345 /share/tmp/Simulation.java
151 /share/tmp/Sky.java
165 /share/tmp/Starfish.java
46 /share/tmp/TimerListener.java
1845 total


No physics lab tommorow, I finnish at 10am!! W00ties :-)