-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
39 lines (32 loc) · 910 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"github.com/buggaarde/The-Sherlock-Layout/layout"
"github.com/buggaarde/The-Sherlock-Layout/text"
)
func main() {
fs := text.AnalyseDir("./texts")
keyb := layout.Load("sherlock.toml")
bestKeyb := keyb
fmt.Printf("Initial layout is the following:\n\n")
layout.Print(bestKeyb)
layout.AnalyseLayout(bestKeyb, fs)
layout.SingleHandUtilization(bestKeyb, "./texts")
temps := []float64{
25000,
15000,
10000, 10000, 10000,
7000, 7000, 7000,
5000, 5000, 5000,
3000, 3000, 3000,
1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
}
for _, initialTemp := range temps {
bestKeyb = layout.Anneal(bestKeyb, initialTemp, fs.T, fs.D, fs.S)
layout.Write(bestKeyb, "currently_best.toml")
}
fmt.Printf("The best layout found by this process is:\n\n")
layout.Print(bestKeyb)
layout.AnalyseLayout(bestKeyb, fs)
layout.SingleHandUtilization(bestKeyb, "./texts")
}