-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.py
More file actions
38 lines (27 loc) · 915 Bytes
/
agent.py
File metadata and controls
38 lines (27 loc) · 915 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
"""
### NOTICE ###
DO NOT revise this file
"""
from environment import Environment
class Agent(object):
def __init__(self, env):
self.env = env
def make_action(self, observation, test=True):
"""
Return predicted action of your agent
This function must exist in agent
Input:
When running dqn:
observation: np.array
stack 4 last preprocessed frames, shape: (84, 84, 4)
Return:
action: int
the predicted action from trained model
"""
raise NotImplementedError("Subclasses should implement this!")
def init_game_setting(self):
"""
Testing function will call this function at the begining of new game
Put anything you want to initialize if necessary
"""
raise NotImplementedError("Subclasses should implement this!")