I played with the mutation rate a bit. Had a 250+ earlier but didn't screenshot it. I climbed the same big hill at around 210, I'm pretty sure it's not random.
The courses are definitely randomly generated, following a formula obviously. That's called 'procedural generation', just so you know.
Obvious to you, perhaps. You're not a machine.
You're not quite getting why this is called a genetic algorithm.
Um, no. I understand *perfectly* what a genetic algorithm is, thanks. I do have a CS degree. You entirely missed my point.
I was saying that a 1% mutation rate doesn't do what you might think from the name - it doesn't appear to be 1% that an organism will have any 1 single change - eg out of 5 generations of 20 cars each, 100 cars in total, you'd expect with a mutation rate of 1% that only 1 single car will have been mutated. My observations show otherwise - I had a population of cars, where every car would get a score of at least 150 with a mutation rate of 0%, and changing the mutation rate to 1% would result in 1 or 2 cars out of those 20 having obvious performance degrading mutations, such that my black line performance dropped noticeably. This shows that a 1% mutation rate is not mutating 1 out of 100 cars, but more like 5-10 out of 100 cars, and I proposed a way by which a 1% rate could mean this - by subjecting each of the 12 individual parts on the car to the rate independently, rather than the car as a whole, you end up with a 'car has at least 1 single mutation' rate of about 11.4%
Further, I used this observation to show that "mutation" means "completely randomize this part", as in pick a whole new random number between 1 and 100 say, rather than "take the existing number and randomly adjust it up or down by 5%". It was doing the former because I went from cars with a score of 150+ to 0-10 instantly. These non-performers were landing in terribly positions or had tiny wheels, while the rest of my population always landed perfectly and have big fat wheels. If it were a simple 5% skew on the current value, I definitely would not have gone to 1-2 non-performers instantly.
So you completely misunderstood what my post was about - I was giving data on how I have observed the mutation system to work:
A) it affects cars piece by piece and
B) it seems to completely randomise the piece, rather than just skewing the value a little.
Both of these aren't very good implementations - it means that a 1% mutation rate actually mutates things much faster than may be expected, and also by completely randomizing a piece in a population that is already achieving well, you are much more likely to degrade performance than you are to improve it. If a mutation meant "skew the value of this variable by a small amount" then with a highly performing population you'd be more likely to have a chance at increasing performance, or only decrease performance by a small amount. Basically genetic algorithms perform simulated annealing and attempt to find a local maxima of performance against the fitness function. The trap is that you'll end up stuck at a non-optimal maxima (see below where I note that my cars perform 197.5 now, whereas I used to get a few at 212) and need mutation to get you out of that maxima - the problem is that completely randomizing a variable, rather than skewing it, is likely to throw you so far away from your local maxima that it's a useless thing to do.
Having said that, this is supposed to be for entertainment, rather than serious modelling to solve a problem. But I think adjusting either point A or B would make this more consistent and interesting - certainly when I had an 8% mutation rate I had a plethora of non-starters, which simply wasn't fun. I'd be more in favour of introducing another slider, "mutation degree" with a scale between 1% and 100% which would indicate the degree of mutation you want. At the beginning you'd probably want a mutation rate of 5-10% and a degree of 100%, and then fairly quickly drop the degree down to 20% or so, and slowly reduce from there, along with the rate. Essentially simulated annealing with a lowering temperature.
I just started 5 different trials that I'm going to run for a few hours with varying levels of mutation, I used 0%, 5%, 20%, 60%, and 100%. About 10 generations in the default 5% is outperforming the others tenfold. It would be interesting to narrow down exactly what rate is ideal.
And because the track is randomly generated each time, this is a meaningless test. Also, if you get a good population to begin with, then your 0% mutation rate has a good chance of easily beating out the other tests, as has happened in my test.
The left one is my simulation that I left running with 8% mutation for about 8 hours, then where the big spike up on the left occurs I had set the mutation rate to 0. A short while later you see a large dip down in the black line - I had set the mutation to just 1% and it made a massive difference in outcomes (lots of non-starters). Putting it back to 0% restored the performance, and as you can see there is now a flat line for red and black and all cars are identical. Interestingly enough, I used to have a few cars that were performing around 212 or so, but it seems they got themselves selected against somehow.
The one on the right is where I tested with 0% mutation from the first generation, you can see the score results very rapidly shot up to about 177. The black line eventually meets the red one and all cars are almost identical now. If I leave it for a few more hours it'll probably winnow out the poor ones.
Attachments:
Post has been edited 6 time(s), last time on Jan 22 2011, 8:46 pm by Lanthanide.
None.