I wrote the original version of this nearly 20 years ago. Cool to see it still pop up here from time to time.<p>Still runs in the browser thanks to Ruffle:<p><a href="https://peteshadbolt.co.uk/posts/ga/" rel="nofollow">https://peteshadbolt.co.uk/posts/ga/</a>
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 Mutation Rate and Mutation Size settings.
this is fun, even though the speed controls aren't super intuitive. You can press "Surprise" to speed things up and go through a bunch of iterations quickly.<p>The mutation rate (likelihood that g changes) and mutation size (Δg) are fun hyperparameters to tweak while watching the population evolve over time.<p>It would be interesting to see a gene for "compliance" so the cars could have some kind of suspension. EVerything more or less evolved into a sort of tron-bike shape for most of the runs I tried.
So boxcar2d, but without flash.<p><a href="https://news.ycombinator.com/item?id=2196747">https://news.ycombinator.com/item?id=2196747</a>
> evolve random two-wheeled shapes into cars over generations<p>Where I come from, we call two-wheeled automobiles motorbikes. Very cool simulation though!
It is a very visual and entertaining visualization, I love it.<p>It inspired me to experiment with a genetic algorithm in "Self-parking car evolution":<p><a href="https://trekhleb.dev/self-parking-car-evolution/" rel="nofollow">https://trekhleb.dev/self-parking-car-evolution/</a>
Reminds me of a phenomenal Android app called Cell Lab where you could create all kinds of multi- or single-celled organisms to live in a petri dish. You could crank up the radiation levels to let things mutate and evolve if so desired.
If you like things like this, join us at <a href="https://old.reddit.com/r/WatchMachinesLearn/" rel="nofollow">https://old.reddit.com/r/WatchMachinesLearn/</a>
Interesting. Is there a way to do this in a 3d physics based simulation environment. It would be cool to see if a genetic algorithm could be used to discover new aerodynamic configurations for drones/other platforms in simulation.<p>I don't know enough about genetic algorithms to say for certain. Anyone have any reference materials for someone that's just started looking into this?
Reminds me dirt bike on Apple Macintosh -- you could edit pretty much every aspect of your dirt bike. Would be fun to make a car/bike game where you play against the GA. <a href="https://www.youtube.com/watch?v=siiho5IVAdg" rel="nofollow">https://www.youtube.com/watch?v=siiho5IVAdg</a>
might go much faster if it recorded a set of states where ancestors died shortly after and then test all the new candidates against those states.<p>The new candidate might actually survive because its prior history kept it from ever getting into that particular death state, but I think biasing towards designs that don't immediately die in those hard cases is good anyways, since given a long enough run it would likely encounter a similar state.<p>One could co-evolve the test case collection by simulating only the best candidates according to the test cases, and then retaining test cases based on a running score for how well they predicted the actual performance.
It references Box2D as the physics engine, but it seems to be a JavaScript port of Box2D. I'm unfamiliar with the JavaScript ports, but if it is a copy of one of the existing ports, the port should be referenced instead.
Btw, how much AI goes into designing the exterior of a car (panels, lights, windows, grill) ? Can they just drag a slider for "How much muscle do you want" from "Yes" to "Beige" ?
This isn't genetic algorithm, though. It's mutation.<p>To do it with a serious model of a genetic algorithm, you need crossover, not mutation. It's fun, but this is sort of a lottery of randomized cars with some capacity for copying winning ones over to successive runs.<p>Breed the cars ;)