
Ask HN: What's the coolest computer simulation you can think of? - cool-RR
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.<p>So I figured I might ask here and get some nice ideas. Do you have any?
======
ivankirigin
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.

~~~
TriinT
It's called Agent-Based Economics:

[http://en.wikipedia.org/wiki/Agent-
Based_Computational_Econo...](http://en.wikipedia.org/wiki/Agent-
Based_Computational_Economics)

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.

~~~
ivankirigin
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.

------
lacker
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.

------
mattiss
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.

------
drcode
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...](http://cs.gmu.edu/~eclab/projects/mason/projects/dewdneybugs/)

------
sp332
> 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 :-/

------
th0ma5
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.

------
pizza
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...](http://blog.electric-cloud.com/2009/09/15/using-markov-chains-to-
generate-test-input/) (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...](http://uswaretech.com/blog/2009/06/pseudo-random-text-markov-
chains-python/) (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.

------
Moschops
"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.

------
aeroevan
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.

~~~
cool-RR
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.

------
steveplace
Black box equities trading + monte carlo voodoo would be nice.

------
lanny
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.

------
newsdog
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>

------
mrshoe
The Matrix

~~~
mpk
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.

~~~
roundsquare
_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.

------
scotty79
Two black holes colliding.

