News for hackers. Stuff that matters.

Ask HN: What's the coolest computer simulation you can think of?

Hello everyone. I'm working on an open-source project called GarlicSim (http://garlicsim.com), which is a Pythonic framework for working with simulations. I've been working on it for about 6 months, and it's progressing, but what I want to have now is a nice example of a simulation to implement with it. I'm free to choose pretty much anything I want. It can be a simulation of physical solid bodies interacting with each other (like maybe a solar system), or of a road system with traffic lights and cars driving through it, or anything else.

So I figured I might ask here and get some nice ideas. Do you have any?

( 23 comments | 19 points | on HN )
Re:Ask HN: What's the coolest computer simulation you can th... by ivankirigin on Wednesday September 16, 2009 @08:08PM (#827118)
A full economy, with people on normal sleep / commute / eat / work schedules. Each person is a free agent. You'd model different relationships and the likelihood of in person interaction.

And then you simulate a zombie outbreak in your virtual society.

Re:Ask HN: What's the coolest computer simulation you can th... by Anon84 on Wednesday September 16, 2009 @11:00PM (#827347)
A full economy, with people on normal sleep / commute / eat / work schedules. Each person is a free agent. You'd model different relationships and the likelihood of in person interaction.

A REALISTIC simulation like this on a global scale would be ridiculously useful in multiple fields. And while several groups have been trying to do something similar, there just isn't enough data for it to work properly at the individual agent level.

(At higher levels you have for example http://www.gleamviz.org/2009/09/us-winter-projections-mitiga... )

Re:Ask HN: What's the coolest computer simulation you can th... by mattrepl on Wednesday September 16, 2009 @10:33PM (#827320)
There actually was a recent paper describing a model of zombie infections, it was mentioned on HN previously.

http://www.mathstat.uottawa.ca/~rsmith/Zombies.pdf

Re:Ask HN: What's the coolest computer simulation you can th... by ivankirigin on Wednesday September 16, 2009 @11:05PM (#827353)
Yeah, I took a lot of interest in that.

Step 3 in the simulation is to make it a game.

Re:Ask HN: What's the coolest computer simulation you can th... by TriinT on Wednesday September 16, 2009 @08:27PM (#827150)
It's called Agent-Based Economics:

http://en.wikipedia.org/wiki/Agent-Based_Computational_Econo...

and it's fun, but somewhat useless. Without analytical results, simulation results tend not to be insightful. You may see that something happens, but you don't understand the causal relations.

Re:Ask HN: What's the coolest computer simulation you can th... by ivankirigin on Wednesday September 16, 2009 @11:06PM (#827357)
But you can get global stats to find interesting things. It's similar to traffic simulation. It is often hard to decipher the cause of patterns, but you can show that a sequence of lights will reduce congestion.
Re:Ask HN: What's the coolest computer simulation you can th... by lacker on Wednesday September 16, 2009 @09:00PM (#827206)
Long ago (1998?) I had a cool screen saver of little creatures that would fight, grow, eat things, reproduce, and evolve. The creatures were just geometric shapes made up of 5-10 lines or so in a 2D world. The evolution worked because there were a few types of lines (like plant, eating-things, defense, reproduction, motion) and each creature had genetic instructions for how to create it like "draw a line of X type that's Y long, then turn Z degrees, then go to the next instruction". You could also set parameters like how strong the sun was and how fast they grew and see how that affected the evolution.

Anyway, it was pretty awesome and I would love to see an updated version or something similar.

Re:Ask HN: What's the coolest computer simulation you can th... by mattiss on Wednesday September 16, 2009 @08:09PM (#827121)
I remember reading an article about fish population simulation in Scientific American a while back. Modeling how fish swim together with external influences like currents, predators etc. etc. Each fish was modeled independently with knowledge only of the fish surrounding it.

The results were very interesting given that the school did some pretty complex things while each individual fish was pretty dumb.

Re:Ask HN: What's the coolest computer simulation you can th... by drcode on Wednesday September 16, 2009 @08:35PM (#827170)
The best "bang for the buck" in a simulation I know of is the evolution simulator from the classic article "Simulated evolution: wherein bugs learn to hunt bacteria" by A.K. Dewdney.

Here's a java applet version someone made: http://cs.gmu.edu/~eclab/projects/mason/projects/dewdneybugs...

Re:Ask HN: What's the coolest computer simulation you can th... by sp332 on Wednesday September 16, 2009 @08:09PM (#827120)
> What's the coolest computer simulation you can think of?

Supernova http://www.flickr.com/photos/argonne/3772984024/sizes/o/ !

> ... a simulation to implement...

Oh :-/

Re:Ask HN: What's the coolest computer simulation you can th... by th0ma5 on Wednesday September 16, 2009 @08:36PM (#827172)
There was this simulator of that hyroplaning / hydrofoil sailboat that may have set the water speed record for sailing... they had their own simulator with the complete code and source available (for the mac). Another awesome sim (imho) is the Charles River RC Simulator, because its physics is so nice. Then other simulators I know of are like the weather simulations used for predictive models, but I think those are all fortran running on big iron. Lots of fun! Be sure to report back here with what you have.
Re:Ask HN: What's the coolest computer simulation you can th... by pizza on Sunday September 20, 2009 @02:26AM (#832804)
All of these use Markov Chains: A weather simulator, that guesses tomorrow's weather by looking at today's state and retrieving the probability of case x tomorrow. Run it a few times, see what the weather patterns look like.

A chat between two bots, that use nlp and maybe an algorithm to check if they make sense. See if they always finish with the same results. Then, apply this to the human mind and reflect.

Great resources: http://blog.electric-cloud.com/2009/09/15/using-markov-chain... (might want to implement the bots from this) http://en.wikipedia.org/wiki/Examples_of_Markov_chains (where the weather idea came from) http://uswaretech.com/blog/2009/06/pseudo-random-text-markov... (simple markov chains in python)

bonus: make the bots have a chat room

P.S. This might not easily tie in with GarlicSim, but I thought these are very interesting topics.

Re:Ask HN: What's the coolest computer simulation you can th... by Moschops on Thursday September 17, 2009 @07:22AM (#827783)
"I think that the message is very clear here: somewhere outside of and beyond our universe is an operating system, coded up over incalculable spans of time by some kind of hacker-demiurge. The cosmic operating system uses a command-line interface. It runs on something like a teletype, with lots of noise and heat; punched-out bits flutter down into its hopper like drifting stars. The demiurge sits at his teletype, pounding out one command line after another, specifying the values of fundamental constants of physics:

universe -G 6.672e-11 -e 1.602e-19 -h 6.626e-34 -protonmass 1.673e-27....

and when he's finished typing out the command line, his right pinky hesitates above the ENTER key for an aeon or two, wondering what's going to happen; then down it comes--and the WHACK you hear is another Big Bang."

In The Beginning Was The Command Line, Neal Stephenson.

Re:Ask HN: What's the coolest computer simulation you can th... by aeroevan on Wednesday September 16, 2009 @09:59PM (#827283)
Just out of curiosity, have you looked into SimPy (http://simpy.sourceforge.net/)?

I've used it before and it is a nice framework for process-based discrete-event simulation.

Re:Ask HN: What's the coolest computer simulation you can th... by cool-RR on Wednesday September 16, 2009 @10:07PM (#827295)
I looked at it, didn't use it. What I'm doing is more state-based: There's an object `state` which describes the state of the world, and these states are ordered in a list to form a timeline.
Re:Ask HN: What's the coolest computer simulation you can th... by steveplace on Wednesday September 16, 2009 @09:36PM (#827255)
Black box equities trading + monte carlo voodoo would be nice.
Re:Ask HN: What's the coolest computer simulation you can th... by lanny on Wednesday September 16, 2009 @09:08PM (#827218)
Blender's Bullet Game Engine? It's fun to dink around with, although it's still has a long way to go before it becomes a viable professional option for me, especially the cloth and fluid simulations, It just takes too much processing power, and the results are hardly stable.
Re:Ask HN: What's the coolest computer simulation you can th... by newsdog on Wednesday September 16, 2009 @10:39PM (#827328)
Creatures. Man that was a great program - I wish I had a spare machine around just to run it full time.

http://www.gamewaredevelopment.co.uk/creatures_index.php

Re:Ask HN: What's the coolest computer simulation you can th... by mrshoe on Wednesday September 16, 2009 @08:26PM (#827147)
The Matrix
Re:Ask HN: What's the coolest computer simulation you can th... by mpk on Wednesday September 16, 2009 @09:21PM (#827233)
I really like The Matrix, but it doesn't make sense for a simulation. It's a movie and there are tons of things that Just Don't Make Sense.

People grow up inside the Matrix, which means that the whole system has to be continuous. No resets, reboots, starting from scratch, etc. So how do you seed this thing? How do you 'start over'?

Then of course there's the whole thing about Skynet (yes, I know, different franchise) using humans for energy. WTF. Kill the humans, put cows in the pods and have the whole simulation be an endless grass field.

I could go on, but, well, I won't.

Re:Ask HN: What's the coolest computer simulation you can th... by roundsquare on Thursday September 17, 2009 @02:12AM (#827527)
People grow up inside the Matrix, which means that the whole system has to be continuous.

Nah, you just implant memories in people in such a way that all of them are consistent (enough) and let the simulation go.

In any event, could be an interesting simulation.

You have a bunch of robots and a bunch of humans. You start with a few humans who are "rebels" and they have certain ways to disrupt the matrix and make other human into rebels. Etc... Could be fun.

Re:Ask HN: What's the coolest computer simulation you can th... by neuromanta on Thursday September 17, 2009 @03:26AM (#827616)
You didn't get the whole point of the Matrix. It's a metaphor. Think about it...
Re:Ask HN: What's the coolest computer simulation you can th... by scotty79 on Wednesday September 16, 2009 @08:57PM (#827202)
Two black holes colliding.