The Computational Beauty of Nature
Computer Explorations of Fractals, Chaos,
Complex Systems, and Adaptation

About the Book
  · title page
  · home*
  · cover artwork
  · jacket text
  · table of contents
  · the author*
  · ordering information
Book Contents
  · three themes
  · part synopses
  · selected excerpts
  · all figures from book
  · quotes from book
  · glossary from book
  · bibliography
  · slide show
Source Code
  · overview &
  · FAQ list*
  · download source code
  · java applets
  · news*
  · reviews & awards
  · errata
  · for educators
  · bibliography (BibTeX format)
  · other links
GASTRING Documentation



       gastring - breed strings with a genetic algorithm


       gastring -help
              [-target  string]  [-size integer] [-steps integer]
              [-seed integer]  [-crate  double]  [-mrate  double]
              [-pbase double]


       Use  a  genetic  algorithm  to  breed strings that match a
       user-specified target string.   This  program  illustrates
       how GAs can perform a type of stochastic search in a space
       of discrete  objects.   Reproduction  of  strings  entails
       crossover  and  mutation with strings being selected based
       on fitness.


       -target string
              Target string.

       -size integer
              Population size.

       -steps integer
              Number of generations.

       -seed integer
              Random seed.

       -crate double
              Crossover rate.

       -mrate double
              Mutation rate.

       -pbase double
              Power base for fitness.


       The fitness function works in  three  steps.   First,  the
       number  of  correct  characters is tallied and denoted the
       raw fitness.  The scaled fitness is then set to pow(PBASE,
       raw fitness - string len).  The normalized fitness is then
       set to the scaled fitness divided by the sum of the scaled
       fitnesses.   Thus the sum of the normalized fitnesses must
       be equal to one while a string with one letter  more  cor-
       rect  than  another  string  is  PBASE  times as likely to
       reproduce, where PBASE is  the  value  supplied  with  the
       -pbase option.


       No  sanity  checks  are performed to make sure that any of
       the options make sense.


       Copyright (c) 1997, Gary William Flake.

       Permission granted for any use according to  the  standard
       GNU ``copyleft'' agreement provided that the author's com-
       ments are neither modified nor removed.   No  warranty  is
       given or implied.

Copyright © Gary William Flake, 1998-2002. All Rights Reserved. Last modified: 30 Nov 2002