forked from berickcook/AIRIS_Public
-
Notifications
You must be signed in to change notification settings - Fork 1
/
airis_test.py
39 lines (27 loc) · 935 Bytes
/
airis_test.py
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
from airis_aux import AIRIS
class Test(object):
def __init__(self):
self.vis_env = [[0]]
self.aux_env = [0, 0, 0, 0]
self.action_space = [0, 1]
self.action = 0
self.action_output_list = [
[1, 2, 1],
[1, 2, 1]
]
self.airis = AIRIS(self.vis_env, self.aux_env, self.action_space, self.action_output_list)
def update(self):
self.action, _, _ = self.airis.capture_input(self.vis_env, self.aux_env, 0, prior=True)
if self.action == 0:
self.aux_env[2] -= 4
self.aux_env[1] -= 1
#self.vis_env[0][1] -= 1
else:
self.aux_env[2] += 4
self.aux_env[1] += 1
#self.vis_env[0][1] += 1
self.airis.capture_input(self.vis_env, self.aux_env, self.action, prior=False)
if __name__ == '__main__':
test = Test()
while True:
test.update()