From: Warren Vonroeschlaub
If you remember Cunchy Frog's original string evolving program you will
recognize this as a variation on it. The recent talk about sex allowing
better convergence to an optimum made me wonder how much better. There
is also the question I have been struggling with recently about how much
muatation and selection is best.
The following program was the result. Sexual or asexual creatures can be
used to evolve any desired string. Also mutation and selection pressure
can be adjusted. This allows a variety of interesting results (ie sex
works well if mutation is rare, but badly if mutation common).
The program has the following parameters:
A string to evolve to must be present. If it contains spaces or special
symbols it must be surrounded by double quotes (""). The string may
contain any alphanumeric character. No control codes or special
characters can be entered.
For example "If we took the bones out, it wouldn't be crunchy." is a valid
string. Some characters a special commands in various operating systems.
obviously these can cause problems.
The s option toggles sex. -s means sex should not be used, +s means it
should. The default is +s.
The -mNUM option sets the mutation rate. The number NUM tells how often
mutation should occur. -m5 means 1 in 5 characters are mutated in each
string. The larger the number the less often mutation occurs. The number
must be an integer between 1 and 32,000. -m10 is the default.
The -kNUM option sets the selection pressure. The number NUM represents the
percent of the population which survives to reproduce. -k30 means that 30% of
the population reproduces, while 70% of the population dies out. -k50 is the
default.
This program was dashed off while I was waiting for my laundry to dry. I
know it can be improved, and welcome any comments. Also, part of the code
came to me in a dream last night. This is not my normal method for
programming, so I apologize if parts are a bit unreadable.
Return to The Skeptic Tank's main Index page.
The views and opinions stated within this web page are those of the
author or authors which wrote them and may not reflect the views and
opinions of the ISP or account user which hosts the web page. The
opinions may or may not be those of the Chairman of The Skeptic Tank.