views:

157

answers:

4

I want to create a city filled with virtual creatures.

Say like Sim City, where each creature walks around, doing it's own tasks.

I'd prefer the city to not 'explode' or do weird things -- like the population dies off, or the population leaves, or any other unexpected crap.

Is there a set of basic rules I can encode each agent with so that the city will be 'stable'? (Much like how for physics simulations, we have some basic rules that govern everything; is there a set of rules that governs how a simulation of a virtual city will be stable?)

I'm new to this area and have no idea what algorithms/books to look into. Insights deeply appreciated.

Thanks!

+3  A: 

I would start with the game of Life.

Stephen Wrighton
+3  A: 

Here is the original SimCity source code:

http://www.donhopkins.com/home/micropolis/micropolis-activity-source.tgz

jedierikb
WOW. Is that legal? In any case, simulating a whole city took Will Wright a couple years and iterations to nail down, I'm sure.
MPelletier
Yes, it is legal. See http://www.donhopkins.com/drupal/node/129
jedierikb
A: 

It may be hard to find any general resources on the subject, because it is quite specific area.

I have implemented some population dynamics and I know that it is not easy to get all the behavior correct to ensure that the population does not die off or overgrows. It is relatively easy if you implement a simple scenario like in predator-prey model, but tends to get tricky as the number of factors increases.

Some advice:

  • Try to make behavior of agents parametrized

  • Optimize the behavior parameters using some soft method, a neural network, a genetic algorithm or a simple hillclimbing algorithm, optimizing a single parameter of the simulation (like the time before the whole population dies off combined with average growth factor)

Marek
A: 

Here is a pointer to some research on the topic, but be advised -- the population in this research study all died off.

http://www.nsf.gov/news/news_summ.jsp?cntn_id=104261

jedierikb