generated from Gophing-Around/hashcode-golang-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
41 lines (34 loc) · 939 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
40
41
package main
import (
"fmt"
"io/ioutil"
)
func main() {
files := []string{
// Uncomment the line with the desired files (add other lines if needed)
"a",
"b",
// "a", "b", "c", "d", "e", "f",
// "a", "b",
// "a", "b", "e", "f",
// "c",
// "d",
}
for _, fileName := range files {
fmt.Printf("****************** INPUT: %s\n", fileName)
inputSet := readFile(fmt.Sprintf("./inputFiles/%s.in", fileName))
config, unMap, servers := buildInput(inputSet)
// fmt.Printf("CONFIG %+v\nunMap: %+v\nservers %+v\n", config, unMap, servers)
// for _, s := range servers {
// fmt.Printf("Server: %+v\n", s)
// }
// printInputMetrics(input)
algorithm(config, unMap, servers)
// for _, s := range servers {
// fmt.Printf("Server End: %+v\n", s)
// }
output := buildOutput(servers)
// printResultMetrics(servers)
ioutil.WriteFile(fmt.Sprintf("./result/%s.out", fileName), []byte(output), 0644)
}
}