Home > evolution, programming, science > Playing with generative algorithms

Playing with generative algorithms

I recently found a small software project while cleaning up some old folders on my PC. The program uses the concept of evolution from biology to solve simple “problems”.

I wrote this code while reading the book The Selfish Gene by Richard Dawkins. Somewhere in that book, the author ask the reader to write their own simulator and I was crazy enough to actually do that…

It was after programming this application and reading several of his books that I decided to start my studies in environmental sciences at the open university in the Netherlands.

Program flow:

  • Enter a ‘secret key’
  • Generate a random string (parent)
  • Generate 1000 strings based on the parent (with minor mutations)
  • Select the child that is closest to the ‘secret key’ (lowest ‘Deltasum’ or the ‘fittest’)
  • This child becomes the parent for the next generation
  • Go back to step 3 until the secret key is found

Code available on GitHub.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: