Basic Genetic Algorithm to evolve a phrase
Ruby C++
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
resources
spec
.gitignore
.rvmrc
Gemfile
Gemfile.lock
README
Rakefile

README

A demonstration of a genetic algorithm written in Ruby.  I needed an algorithm like this to be used in a shift scheduling application that I am writing.  Porting from c++ to Ruby was a great exercise and enabled me to understand the code better.

Basically, all this does is go through each member of the population and compare it with the target string. It adds up the differences between the characters and uses the cumulative sum as the fitness value (therefore, the lower the value, the better).

This was ported from a c++ program that can be found here:

http://www.generation5.org/content/2003/gahelloworld.asp