Wednesday, April 25, 2007

First Predator

Well I couldn’t wait so I made a simple predator that ate one rabbit a day. Needless to say the current scale can not support 1 predator that eats 1 rabbit a day. I now know that I need a stable population that needs to stay above 200 to keep the predator alive and still have rabbits.

Another thing to add to the list is to expand the world, and to modify the rabbit so that he can see and move into the expanded areas. Since I am expanding the world, might as well change the weather to a grid level instead of the individual cell levels that it is currently running on.

Friday, April 20, 2007

Rabbit Graphs

Ran through several 2500 day simulations, They all look similar even after getting rid of the Genghis Horde maybe just a little less volatile.

The first one is of the Genghis Horde. The initial peak was shortened due to my noticing a few things wrong with the code.






The rest follow the same pattern, just less volatile. The initial spike does go higher due to the spreading out of the rabbits.







More of the same. This one looks like I had more rain falling for a short time span leading to a larger spike leading to a population of over 200 for a few days.










This on just shows that the range is similar to the second run. I'll do a few runs out to 5k days, but I don't expect to see much change.



I did change a few items. The scripts that I use to advance the days, I added some database maintenance scripts to improve performance. The first run took 8 hours. The second took 5 after I made manual interventions. The third and fourth runs took 2 hours each after adding the changes. Of course none of the code is optimized, and the database doesn't have any indexing.

The last big environmental change I need to add back is when an animal dies a part of it goes back into the land as vitality. This should boost the base line population, as well as cause an echo from the initial spike.

Two things I've noticed so far. One, grazers if left unchecked will devastate the land and have massive die off cycles where 50-60% of the populations dies off in a short space of time dues to starvation. Second, the map is mostly brown and yellow. The brown tiles represents bare ground no grass growing. Yellow means sparse amounts of grass. I'm sure if I was going to model environmental effect this would eventually turn into desert or a barren wasteland.

Over the next few weeks, I'm going to review the current code and replace the code with procedures. I've created a few procedures, but some of the code generated this week is directly into the main code loop. Then I'll look at encapsulating the procedures into objects. Once that is completed, I'll look at making the undying, non breeding, predator. I'm thinking Fox at this point.

Labels:

Thursday, April 19, 2007

Genghis Rabbit Hordes

Ran through a 2000+ day simulation over night. The days start to drag as the number of animals increase. The early part revealed a few bugs I had on removing dead rabbits. I also saw a big trend when there are a lot of rabbits running around looking for something to eat. I'll call it the Genghis Rabbit Horde affect. The rule for the rabbits was to eat then move to the best place to eat next ("The grass is always greener rule"). This led to a horde of rabbits moving together from one cell to the next. The bad thing is that the horde would get so big that not all of the rabbits would have something to eat. This led to massive die offs from starvation. I expect boom bust cycles, but I think this pattern exaggerates the cycle magnitude.

I set up a simple history tracking table, at the end of each day it takes the average vitality of the cells in the grid and the number of rabbits. I'll post some pictures of the graphs later after going through several runs.

I made a change in the order of what the rabbits do. It moves to a new cell then eats. Hopefully this will cut down on the horde affect.

World Display

Labels:

Wednesday, April 18, 2007

Die Rabbit Die

Rabbits can now die. The earliest scheduled death is day 1825. I'm glad I limited the first initial birth rate to a single rabbit.

Updated the display to show a count by animal.

With that many rabbits running around eden is starting to look like a dust bowl.

I also upped the hourly calculations to a 100 days per hour.

World Display

Next step is to setup an animal vitality so that they can starve to death, and set a limit on when the land vitality goes down to a certain level they can no longer eat / draw vitality from the land.

Labels:

Tuesday, April 17, 2007

Rabbit’s a multiplying

Have the rabbits a multiplying, I took the easy way out. Just gave the females a 1 in 32 chance of being preggers if they are not already pregnant. No male needed in the equation. :)

My first glance at the initial rabbit data, it appears that I’m leaving out adding in how many days the rabbit will live. Need to correct that. Most of the animals will have a set length of time that they will live. If you are not eaten, you will die, eventually.

Currently there isn’t a check to see if a rabbit has met its death day. I’ll have this change in before they would meet their normal death from old age.

I was watching a discovery show a few weeks back about mice. A fox would need to eat over 7000 mice a year to survive. Not sure how many mice translate into a rabbit for energy equivalents.

Busy Work Weeks

I’ve been busy the past few weeks with projects at work, production issues, and support of an extremely old and out of date piece of software. The project is on a successful track so far. This project is the upgrading of the extremely old and out of date piece of software. Preliminary testing is going to start this week. There are some technical difficulties to overcome and migration paths to lay out. Overall, I have an upgraded version of the software and it appears to be mostly working. Not bad for a first pass at an upgrade on something that is over 4 years old in age, highly customized and 13+ releases behind.

Another side project has knocked my computer off the network, while I work on the issue. Apparently, AP uses a separate third party tool to print their checks. The software is loaded on only one machine, and the lease is up for that machine. The first attempt failed on moving the program. After looking around at stuff, I found that they have not archived any of the payments files since they installed the program. There are over 4000 payment files and 3 gig of data in a single folder out on the network. It takes over 5 minutes to do a task in that folder. It is time to zip and delete all of those files.

While, they are zipping I’ll work on my updates.