Generate the "perfect" keyboard layout using evolutionary computing!
Implementation of this video by adumb.
Uses the EC Program structure created by my professor and advisor Dr. Taylor for his EC class at Missouri S&T.
Use pipenv to create the environment with the Pipfile. If you don't want to, the only package you need is tqdm.
Download the archive.org dataset from here and extract to data/arxiv-metadata-oai-snapshot.json
If you are using pipenv:
pipenv shell
pipenv run python kb_ec.py
If you are just using normal python:
python kb_ec.py
Only tested on linux.
As mentioned in adumb's video the keyboard representation is top left to bottom right, column wise. So QWERTY would be:
qazwsxedcrfvtgbyhnujmik,ol.p;/
The fitness function measures the distance between consecutive key presses. Adumb's video explains it really well.
Unfortunately they did not include in their screen capture, so I had to improvise and it is quite ugly.
Starting from a random location, a random amount of keys will be copied from the first parent to child. The second parent will fill in the rest of the keys, without duplicates, according to the order the occur in the second parent's genome.
10% of individuals will have two random keys swapped.