Source

evolve-keyboard-layout / evaluate_efficiency.sh

#!/bin/bash

if [ $# -lt 1 ]; then 
    echo "usage: $0 <identifier>"
    exit 0
fi

if [ "$1" == "--help" ]; then
    echo "usage: $0 <identifier>"
    exit 0
fi

echo create data
for j in 600 {1..6}000
    do time ./check_neo.py --evolve $j --prerandomize 1000000 -v -q --controlled-tail >> results/$1-evolve-$j-results.txt
done

echo check and plot the data
echo … final penalty 
for j in {1..9} {1..9}0 {1..9}00 {1..9}000 {1..3}0000; do grep "billion total" results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done > results/$1-evolve-range-final-penalty.txt 
echo … finger repeats
for j in {1..9} {1..9}0 {1..9}00 {1..9}000 {1..3}0000; do grep 2gramme results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done > results/$1-evolve-range-finger-repeats.txt 
echo … finger disbalance
for j in {1..9} {1..9}0 {1..9}00 {1..9}000 {1..3}0000; do grep "disbalance of the fingers" results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done > results/$1-evolve-range-finger-disbalance.txt
echo … key position cost
for j in {1..9} {1..9}0 {1..9}00 {1..9}000 {1..3}0000; do grep 1gramme results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done > results/$1-evolve-range-key-position.txt
echo … key handswitching
for j in {1..9} {1..9}0 {1..9}00 {1..9}000 {1..3}0000; do grep handswitching results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done > results/$1-evolve-range-handswitching.txt

# and old style results
for j in {1..130} 1{4..9}0 {201..205} {301..305} {401..405} {601..603} {1001..1003} 10000; do grep "billion total" results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done >> results/$1-evolve-range-final-penalty.txt; for j in {1..130} 1{4..9}0 {201..205} {301..305} {401..405} {601..603} {1001..1003} 10000; do grep 2gramme results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done >> results/$1-evolve-range-finger-repeats.txt; for j in {1..130} 1{4..9}0 {201..205} {301..305} {401..405} {601..603} {1001..1003} 10000; do grep disbalance results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done >> results/$1-evolve-range-finger-disbalance.txt; for j in {1..130} 1{4..9}0 {201..205} {301..305} {401..405} {601..603} {1001..1003} 10000; do grep 1gramme results/$1-evolve-$j-results.txt | cut -d " " -f 2| sed "s/^/$j /" ; done >> results/$1-evolve-range-key-position.txt
echo with pyxplot
# pyxplot evaluate_efficiency.pyx
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.