-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
41 lines (38 loc) · 767 Bytes
/
main.go
File metadata and controls
41 lines (38 loc) · 767 Bytes
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 (
"os"
"strconv"
"github.com/renatobrittoaraujo/rl/appmanager"
"github.com/renatobrittoaraujo/rl/input"
)
func main() {
args := os.Args[1:]
trainMode := false
inputMode := input.AIInput
var seed, fps int
for _, arg := range args {
if arg[0:3] == "fps" {
fps, _ = strconv.Atoi(arg[4:])
continue
}
if arg[0:4] == "seed" {
seed, _ = strconv.Atoi(arg[5:])
continue
}
switch arg {
case "train":
trainMode = true
case "hardcoded":
inputMode = input.HardcodedInput
case "user":
inputMode = input.UserInput
case "ai":
inputMode = input.AIInput
case "draw":
trainMode = false
default:
panic("Invalid CLI argument")
}
}
appmanager.StartSimulationDriver(!trainMode, inputMode, seed, fps)
}