https://github.com/stopyransky/to-be-or-not-to-be-genetic-algorithm
Simple genetic algorithm simulation as described in book "Nature of Code" by Daniel Shiffman. Originally written in processing, here adapted to JavaScript and runnable in Node.
https://github.com/stopyransky/to-be-or-not-to-be-genetic-algorithm
Last synced: 2 months ago
JSON representation
Simple genetic algorithm simulation as described in book "Nature of Code" by Daniel Shiffman. Originally written in processing, here adapted to JavaScript and runnable in Node.
- Host: GitHub
- URL: https://github.com/stopyransky/to-be-or-not-to-be-genetic-algorithm
- Owner: stopyransky
- License: mit
- Created: 2017-04-29T19:42:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T20:21:17.000Z (over 7 years ago)
- Last Synced: 2025-01-22T13:51:40.936Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Simple genetic algorithm simulation as described in book "Nature of Code" by Daniel Shiffman.
Originally written in processing, here adapted to JavaScript and runnable in Node.To run, navigate to repository directory, enter "node" in terminal and type:
```javascript
.load main.js;
sim.printInfo(); // to get info, pass true for verbose, false for short info
sim.runOnce(); // to move simulation one generation further
sim.run(); // to move simulation 100 generations or > 90% fitness further
sim.setFitnessFunction( yourFunctionReturningNormalizedFitness );
```