https://github.com/icholy/simple-genetic-algorithm
messing around with genetic algorithms
https://github.com/icholy/simple-genetic-algorithm
Last synced: over 1 year ago
JSON representation
messing around with genetic algorithms
- Host: GitHub
- URL: https://github.com/icholy/simple-genetic-algorithm
- Owner: icholy
- Created: 2015-08-08T04:02:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-19T16:18:50.000Z (almost 11 years ago)
- Last Synced: 2025-01-30T03:13:10.020Z (over 1 year ago)
- Language: TypeScript
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Genetic Algorithm
This is a simple and naive implementation of genetic programming.
It's based on what I learned from the first part of [The Field Guide To Genetic Programming](http://www.gp-field-guide.org.uk/).
I wanted to make sure I understood the basic concepts before moving on to the more advanced material in the book.
* This implementation tries to match the following function `y = (x * x) + x + 1`.
* The initial population uses a ramped half and half (grow and full methods) from 2 - 6 depth.
* Population size is 10000
* The individual error is total sum of the errors of all the tested samples.
* Parents are the 100 individuals with the lowest errors.
* The new population is created using subtree mutation and subtree crossover on the parents.
* Function set: ADD, SUBTRACT, MULTIPLY, DIVIDE
* Terminal set: 5 constant terms, 1 input term (X).