Article Preview
Buy Now
| Print: | |
| PDF: |
Algorithms
Genetic Algorithms, Part 2
Improve Your Computer's Sex Life
Issue: 2.1 (August/September 2003)
Author: Matt Neuburg
Author Bio: Matt Neuburg is the author of
Article Description: No description available.
Article Length (in bytes): 7,716
Starting Page Number: 34
RBD Number: 2116
Resource File(s):
2116.sit Updated: Friday, October 17, 2003 at 12:21 PM
Related Web Link(s):
http://www.geatbx.com/docu/algoverv.html
Known Limitations: None
Excerpt of article text...
Last month's column introduced genetic algorithms, where we simulate Mendelian/Darwinian evolution as a way of solving some problem. We start with a population of individuals, each endowed with some DNA. We regard each individual's DNA as a possible answer to our problem, and we rank it according to how good an answer it is. We take the individuals with the best DNA and mate them, generating a new population, repeating the process again and again.
The "problem" in this case, you may recall, was to arrive at a good sequence of bytes, where "goodness" is defined as follows. Every byte is translated into an alphanumeric character or a space, thus arriving at a series of words. A word like "9BJ6" is bad, and reduces the cumulative value of the DNA by multiplying it by 0.8. A word comprising entirely digits, like "46", adds to the cumulative value of the DNA a number of points equal to its length. The word "M" doubles the cumulative value of the DNA. A word like "AG12589" -- the letter "A" followed by only non-digits followed by only digits -- multiplies the cumulative value of the DNA by the numeric value of its digits part. Although this is not an earth-shattering problem, it makes for a good example, since it turns out that in 100 generations, the computer is able to optimize its byte sequence very strongly with respect to these rules.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|










