I’ve added two new resources to my resources page:
April 26, 2005
This next variation on the theme introduces several new components. First, the code for an individual parent or child has been set into an “Individual” class. The Individual includes the AminoCode to compare against the target, as well as that individual’s respective score. This enables us to cut down the score calculations considerably and thus reduce the time it takes to go through each generation by one third. It is also useful in that it groups the individual’s characteristics together and allows it to be treated as a unit.
April 17, 2005
This latest version incorporates a fixed mutation rate, rather than a fixed number of mutations per child. This decreases the efficiency of the algorithm from an average count of 47 generations with a standard deviation of 10 generations to an average count of 77 generations with a standard deviation of 24 generations (over 200 runs each). The best rate I could find was at 1 out of every 26 – for the original 1 out of every 28, the results were an average count of 79 generations with a standard deviation of 24 generations.
I did not include the standard output, but it would be essentially the same as the previous version of the program, except that the last line will have a count of around 77 generations.
April 15, 2005
The second version of the Methinks program is listed below. A few notes may be in order…
First, I’ve switched from a string based system to an array based system to speed things up a bit. This speeds up the performance by a factor of three.
Second, the mutate function has been changed to give a true mutation rather than just a 26/27 possibility that the value will mutate. (This method will not allow the result to be the same as the original value.) This should give results which are truer to the definition.
Third, I’ve used a slightly more deterministic selector than previously. The current selector simply counts the number of positions that are not equal to those in the corresponding target string. This increases the speed in which the target is reached (which makes it more of a best-case scenario), and makes for a simpler analysis.
Fourth, I’ve cut down the output by only outputting on every 10^nth value, and the final value. This just makes for a more summarized result.
April 11, 2005
I’ve decided to do a little study on Dawkin’s tired old “METHINKS IT IS LIKE A WEASEL” algorithm. The first step is obviously to replicate the original behaviour. The following code and results were written in VB6. I’ll try to include source code throughout the study. This version should be like the original with n generations of x offspring moving towards a target phrase. Phrases are scored according to the sum of the similarities of each letter to their corrosponding letters in the target phrase. Since we are only using one of the offspring as the new parent, and since this is always the best of the offspring, we need not keep an array of results. The following code should suffice: