Talk:Evolutionary algorithm: Difference between revisions

Line 126:
I've run the Weasel simulation for some larger target phrases. I was curious to see how the target phrase length affects the number of iterations. I'm guessing that to model a real life organism would require thousands of characters. It seems that as you increase the target phrase the number of iterations required goes up dramatically (possibly exponentially). With a phrase of 600 characters, after 10 million iterations the program hadn't got very far.
I am ignorant of biology so I don't know how a natural example would work. What variables etc should be changed to make this more realistic? Can the phrase be broken down into smaller chunks and then solved and still be an evolutionary algorithm? I realize that I shouldn't over-complicate a simple model. Ideas? --[[User:Davidj|Davidj]] 02:18, 11 October 2011 (UTC)
: Based on previous talks, I'm assuming you are experimeting with the C code. A few things:
:* I made a rookie mistake in the <code>CHOICE</code> macro. It should be <code>sizeof(tbl) - 1</code>.
:* Mutate rate of 1/15 is too high for long strings. When offsprings mutate too much, the effectiveness of inheriting from a fit parent is suppressed. Think it this way: if <code>MUTATE</code> is 1, i.e. every letter always mutates, you are effectively generating a completely random string every time, and fitness of parent string is ignored. In that case, for a 600 letter string, you have a chance of 1 in 27<sup>600</sup> to match regardless of current parent, and given a 32 bit random number generator, chances are it's never going to happen. Try set <code>MUTATE</code> to, say, 1000.
:* This task is more of a demonstration than a simulation of evolution. It demonstrates how inheritance helps reduce generations needed to improve a species' average fitness to a dramatic level, but don't take it at the face value and think evolution works exactly like it in nature.
Anonymous user