I’ve let it go for about 8 hours now, and I’m up to 28 generations where the best car has gone 200 units. Its interesting to watch and I’ll describe the best I know of whats going on.
There seem to be about 20 ‘cars’ that are trying to go some distance, after all 20 go, a new generation starts…but that new generation includes some mutation of the design (5%) in my case. eventually after successive generations the mutated cars go further. You can try it and see what I mean.
How is this algorithm set:
are the 20 cars representing 20 individuals that are independent of each other? If so, does that mean I’m watching 20 lineages of mutation and seeing if one lineage eventuallly works better than the other?
2)How are the ‘successful’ mutations in this algorithm preserved? it seems that if you don’t selectively keep an improvement, you will lose it.
are the improvements realized by a particular individual in a generation, somehow transmitted to the other individuals; so that the population tends to become a better fit(go further distance) over time?
I’ve got some minor questions, like what do the graphs that are plotted on the screen mean, and what is the purpose of the numbers in the parenthesis? (for example: if an individual car goes furthest at 101 units in a generation, than the next generation has 202 in parenthesis)
Hope I’m clear:
Hard to tell exactly what’s going on, but after a watching it a while here’s what I’m thinking:
Each of the 20 cars is independent.
Not sure, but my guess is that it just compares generation (n) with generation (n-1) and creates generation (n+1) by applying the mutation algorithm to the one with the higher score.
I don’t believe there’s mechanism that propagates characteristics across the lineages. Each car is competing against its ancestors, not its peers.
Pretty sure the red line is graphing generational high score and the black line is graphing generational average score. The number in brackets is the length of the course for the generation, and is somehow tied to previous high scores.
That sounds about right, but I would normally reserve the phrase “genetic algorithm” for something modeled off sexual reproduction. If they did that, you’d be seeing better cars much more quickly.
Except that there is reference to “crossover,” which I would take to indicate some sort of sexual reproduction. Also, I see peculiar design features, not clearly beneficial, becoming common among my cars.
Well that’s kind of a literal interpretation of the term ‘evolutionary landscape’… And why do my e-volvos just keep genetically drifting off into la-la land?
Just going from observation, I think that there is some kind of selection going on between the different car models; perhaps only the 10 most successful (as measured by how close they come to the set target) are kept, and then mutated?
In the first round the cars have one colour each; in subsequent generations the colours are mixed, so I think there is some kind of sexual reproduction there. It would be more fun if one could selectively breed them and kill off unproductive strains.
In fact, after 25 generations, I have only 7 colors left, so I guess that means that the genetic material of 13 cars from the original 20 is lost forever.
Based on comments on the linked web site, the red score is the sum of the two highest scores from the last generation. I think the red graph is graphing that sum, and the black is graphing the average across all cars.
The score in parentheses is 2x the highest single score in a generation, and not the sum of the two highest. Dunno why it is that, but it definitely is. The red graph might be the sum of the two highest; it’s somewhat hard to tell.
after 40 generations and about 18 hours, mine have been ‘stuck’ at around 200 or so. THere’s a virtually impassible stretch of the road that they’ve been getting stuck on. It’s the automotive evolutionary equivalent of an asteroid impact.
Mine too. Although in generation 5 I had 3 different species go over 400, but due to the trait of over-rotating counter clockwise and getting stuck on a specific section around 170 too often the really good designs (the 400-500+) were bred our and I now am stuck with the 170-200s. Fascinating!
I wish I could recreate as it is such the perfect example for how secondary traits are selected for.
This program has done one thing: gotten my cat interested in computers. Right now, all she does is try to catch the track the cars ride on, or failing that, to eat it. But I figure it’s only a matter of time until she’s using debuggers and writing perl scripts…
As best I can tell, the red graph is just tracking the highest score, not the sum of the two highest.
Did you turn the mutation rate right down once you’d got a good design going? That’s what you need: you need a high mutation at the start to span as much of the search space as possible, and to reduce it to almost nothing as you home in on the best design.
My cars did something similar. They peaked at generation 10 for both the black and red graph, with a peak distance of about 270. Then they started to tank. They all became very front-heavy and tried to correct for that by shifting the front wheel out and up. While this was a partial fix for the front-heavy problem, it meant they started snagging the bottom on peaks. From generation 10 to 15, the front-heaviness trait got bred throughout every line of cars.
Of course, some lines always favored wheels on top rather than on the bottom. That trait never bred out either. Instead, they bred themselves to tip over so that they could get 0.5 instead of 0.0.
The number in parens (double the previous generation’s top score) is actually a limit. Any car that reaches that score has its run terminated. This usually only happens in the first few generations.
BTW, I count 30 genetic traits that determine the make up of the car.