https://github.com/michaelaquilina/me-thinks-it-is-like-a-weasel
Simple Genetic Algorithm inspired by Richard Dawkin's "The Blind Watchmaker"
https://github.com/michaelaquilina/me-thinks-it-is-like-a-weasel
Last synced: 3 months ago
JSON representation
Simple Genetic Algorithm inspired by Richard Dawkin's "The Blind Watchmaker"
- Host: GitHub
- URL: https://github.com/michaelaquilina/me-thinks-it-is-like-a-weasel
- Owner: MichaelAquilina
- License: mit
- Created: 2014-01-25T00:04:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-25T15:38:11.000Z (over 11 years ago)
- Last Synced: 2025-03-11T01:55:56.290Z (7 months ago)
- Language: Python
- Size: 199 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Me thinks it is like a weasel!
==============================Simple script which generates any given input phrase using an extremely simple
genetic algorithm.This mini-task was completely inspired and based off what Richard Dawkin's performs in
his book 'The Blind Watchmaker' as a way of explaining accumulations of random small change to
generate complex sequences through selection and inheritance.The script runs with Python 2.7
By default, the script will generate 'Me thinks it is like a Weasel' which is what Richard Dawkin's
uses for his example. The phrase is an excerpt from Hamlet. You can specify a different target as follows:python weasel.py --target "My Message Here"
Additionally, you can specify the mutation rate, the population size and which crossover operator to use:
python weasel.py --mutation-rate 0.2 # Mutation rate of 20%
python weasel.py --population-size 200 # Population size of 200
python weasel.py --crossover 1X # Use single point crossover
python weasel.py --crossover uniform # Use uniform crossoverYou can view a detailed list of options by typing `python weasel.py -h' for the help.