Live data from Hacker News

Watch cars evolve using genetic algorithm

rednuht.org

51–60 of 76 posts

Re: Watch cars evolve using genetic algorithm

#51
post #11

I wrote the original version of this nearly 20 years ago. Cool to see it still pop up here from time to time. Still runs in the browser thanks to Ruffle: https://peteshadbolt.co.uk/posts/ga/

I worked on Adobe’s Flash Player team at that time and I remember using your Flash movie as a test case. :)

Wow, thank you for sharing this. Means a lot

Re: Watch cars evolve using genetic algorithm

#54

> evolve random two-wheeled shapes into cars over generations Where I come from, we call two-wheeled automobiles motorbikes. Very cool simulation though!

The simulation that these cars are driving in has no third dimension for the vehicle to fall over into (or where to put another pair of wheels). So, like a traditional four-wheeled car, these vehicles do not tip over at 0 velocity. I think that property is enough to qualify their behaviour as more similar to four-wheeled cars than motorbikes.

Re: Watch cars evolve using genetic algorithm

#55

It seems to always get into a rut where one design lucks out and dominates generation after generation, with no mutations producing anything even close to working. Like, the top ten don't change after hundreds of generations. Maybe this is just an attribute of genetic algorithms. They quickly zero in on something kind of good, and then get stuck at this local maxima. Or maybe I need to just play around with the Mutat…

In general, one should keep the mutation rate really low to allow the population slowly change over time. High mutation rate will lead to local optima quickly but also very hard to get out. Low mutation rate will require significant more generations but in general result in better adaptation.

Re: Watch cars evolve using genetic algorithm

#58

So boxcar2d, but without flash. https://news.ycombinator.com/item?id=2196747

... Apparently boxcar2d works perfectly in Ruffle, which the Internet Archive automatically loads :)

https://web.archive.org/web/20240428203838/http://boxcar2d.c...

Re: Watch cars evolve using genetic algorithm

#59

It seems to always get into a rut where one design lucks out and dominates generation after generation, with no mutations producing anything even close to working. Like, the top ten don't change after hundreds of generations. Maybe this is just an attribute of genetic algorithms. They quickly zero in on something kind of good, and then get stuck at this local maxima. Or maybe I need to just play around with the Mutat…

It seems like more should change than just the shape. I'd wager that a slower car with more power may be less likely to get stuck in ruts. But it seems that the power and speed don't vary, just (barely, after a few generations) the shape.

Edit, I scrolled down and it covers the genome:

• Shape (8 genes, 1 per vertex)

• Wheel size (2 genes, 1 per wheel)

• Wheel position (2 genes, 1 per wheel)

• Wheel density (2 genes, 1 per wheel) darker wheels mean denser wheels

• Chassis density (1 gene) darker body means denser chassis

It basically lands on a two-wheeled medium-bodied shape and doesn't seem to make much progress after that. Power and speed would be interesting variations.

Post reply on HN