-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
executable file
·58 lines (48 loc) · 1.16 KB
/
setup.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
printf "Make sure you have python3.7 and virtualenv installed before continuing! Press enter to continue, or Ctrl-C to quit."
read tmp
printf "Absolute path to python3.7: "
read pypath
virtualenv --python=$pypath venv
source venv/bin/activate
pip install -r requirements.txt
# Write updated conditions and RAM maps to respective files
cat <<EOF > venv/lib/python3.7/site-packages/retro/data/stable/GalagaDemonsOfDeath-Nes/scenario.json
{
"done": {
"variables": {
"stage": {
"op": "equal",
"reference": 0
}
}
},
"reward": {
"variables": {
"score": {
"reward": 1
}
}
}
}
EOF
cat <<EOF > venv/lib/python3.7/site-packages/retro/data/stable/GalagaDemonsOfDeath-Nes/data.json
{
"info": {
"lives": {
"address": 1159,
"type": "|u1"
},
"score": {
"address": 225,
"type": ">n6"
},
"stage": {
"address": 1155,
"type": "|u1"
}
}
}
EOF
python -m retro.import .
printf "All done! Use\n\nsource venv/bin/activate\n\nto enter the environment, or run demo.sh to start a 5 episode demo of training the Uniform Single Q-Learning network!"