Live data from Hacker News

Watch cars evolve using genetic algorithm

rednuht.org

21–30 of 76 posts

Re: Watch cars evolve using genetic algorithm

#21
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/

Do you have some examples of results when running this for a few days?

Or perhaps, 20 years? ;-)

Re: Watch cars evolve using genetic algorithm

#22
post #16
post #7

Why are the cars so spiky and why do they stay that way? Mostly what I saw was the wheels move and change size.

Looks like their shape is always defined by eight triangles. The page doesn't say what the genome defines about those triangles (only that there are eight vertices in the genome), but if it's just random angles and distances, it'd kind of make sense that they start as random spiky shapes. I don't know why they stay that way. My first thought would be that it might be beneficial for the shape to be relatively low for…

Both runs I did the cars looked like a child drawing a car from Mad Max.

My best guess is sort of adjacent to yours: a lot of cars flip on the initial drop and I think the spikes are helping them land right side up. Overfitting T=[0,1]

Re: Watch cars evolve using genetic algorithm

#24

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

I knew I had seen something like this over a decade ago!

This html5 version has also been around for longer than a decade already. It's what inspired me to take a class on Genetic Algorithms and Evolutionary Computing in university back then.

Re: Watch cars evolve using genetic algorithm

#25
post #5

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" ?

I don’t think they use generative AI much in automotive design today, but you can play with stable diffusion and embeddings and make a slider for muscle cars in the textual weights.

Re: Watch cars evolve using genetic algorithm

#27
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/

Do you have some examples of results when running this for a few days? Or perhaps, 20 years? ;-)

Or another civilization wrote it a few, billion years ago. We might see the results fly by our planet this week.

Re: Watch cars evolve using genetic algorithm

#28
This isn't genetic algorithm, though. It's mutation.

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.

Breed the cars ;)

Re: Watch cars evolve using genetic algorithm

#29

This isn't genetic algorithm, though. It's mutation. 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. Breed the cars ;)

Why is this not a genetic algorithm? Genetic evolution does not require crossover.

Re: Watch cars evolve using genetic algorithm

#30
post #9

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. The mutation rate (likelihood that g changes) and mutation size (Δg) are fun hyperparameters to tweak while watching the population evolve over time. It would be interesting to see a gene for "compliance" so the cars could have some kind of suspension. EVerythin…

> EVerything more or less evolved into a sort of tron-bike shape for most of the runs I tried.

I ran it in the background for a very high mutation rate for a long time and it managed to come up with something very different---a little wheel attached to a big wheel, which bounces around and goes over all the obstacles.

Post reply on HN