

Genetic Algorithm Car Physics - aerique
http://www.reddit.com/r/programming/comments/f6g98/genetic_algorithm_car_physics/

======
josh33
Why is this linking through Reddit? Link directly to the source:
<http://ycombinator.com/newsguidelines.html>

~~~
Toucan
Reddit is the source. equalRightsForRobots created it, and is writing about it
in that post.

~~~
aerique
That is indeed why I linked through Reddit. I had pasted a direct link first
in the submit form but changed my mind because the creator was commenting in
the Reddit thread.

------
aikinai
I think this might have been the original swf the Reddit one is based on:
<http://www.qubit.devisland.net/ga/index.html>

I found this one years ago and have been meaning to try copying it one day
myself to learn about genetic algorithms.

~~~
sskates
Lots of people on the Reddit thread are really into it: "It's heartbreaking
when it spawns a totally sweet car, upside down." "my entire office is idle
cheering nonentities on"

It's hard to imagine anyone getting as excited about the swf you just linked
to.

It's interesting from a user experience perspective as the programs are doing
almost the same thing.

There's the colorfulness of the one on Reddit, making the cars more
personable. In contrast, the other program kills unsuccessful cars very
quickly, without giving you time to think about why the car was
unsuccessful/feel its pain. Also, the load bearing concept might be cool in
theory, but I think it makes it more difficult for the viewer to process
what's going on.

It's also interesting how both authors consciously chose to make their
algorithms worse so that the program wouldn't converge to a solution as
quickly.

~~~
user24
I think the reason behind this is struggle. The original killed cars as soon
as they started struggling (the load hits the ground). The latest allows you
to watch bad implementations struggle to traverse the landscape.

That's all. There's probably a deep lesson in there somewhere.

------
pavel
It would be interesting to see how a car designed by a person would perform.
Maybe make it a competition where two players design a car and then compete on
some randomly generated terrain.

------
stalf
This is really great! After 5 generations, the algorithm gets the wheel
positioning/size right. In a few more, it figures how the lower middle portion
of the car should be.

I'm in the 9th and I've already seen it go past 150.

~~~
jws
Mine go further (230+) but I got a weird duncecap-like structure over the rear
wheel that keeps cropping up, putting the center of gravity too far back and
making them fall over backwards. Interestingly, instead of getting rid of the
balance problem, my cars are evolving a wheely bar to prevent the backward
flip at the expense of speed.

I wish the goal involved speed in combination with distance.

Update: stagnation after generation 10. I spun up another instance and it is
amazing how different that one is evolving.

~~~
darkxanthos
You can also up the mutation rate to knock it out of a rut

~~~
Devilboy
I'm experimenting with 'intelligent mutations' - when the cars look promising
I reduce the mutation rate and when it looks stuck in a rut I increase it
again.

------
RiderOfGiraffes
Very similar to an item from nearly two months ago:

<http://news.ycombinator.com/item?id=1949947>

------
iwwr
Pretty slow, you need 20 or so generations to start getting interesting
results.

Edit: after letting it run 30 generations, the best car went past 200.

~~~
nervechannel
That's not slow. In 20 generations, humans hardly change at all.

~~~
feral
If you take a population of humans, put them on an island, and only allow
those that grow tall to breed, after 20 generations you will notice a huge
difference in the average height of your population.

You might already be aware of this, but it is important not to confuse the
slow mutation rate, with a slow response to selection pressure.

Nor is it appropriate to generalise that because the modern day selection
pressures are mild, humans somehow evolve 'intrinsically' slowly.

The 'cars' are evolving fast, because those with a low fitness are ruthlessly
culled. Human populations can change fast when comparably strong selection
pressure is applied.

~~~
liuliu
The 'cars' population is pretty small too. Generic algorithm needs large
population to have a good result.

~~~
iwwr
It plateaus around 195 distance after about 15 generations.

------
superjared
Finally, a use for Web Snippets.

