forked from addy369/AnimalAI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
agent.py
34 lines (28 loc) · 1.25 KB
/
agent.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
class Agent(object):
def __init__(self):
"""
Load your agent here and initialize anything needed
WARNING: any path to files you wish to access on the docker should be ABSOLUTE PATHS
"""
pass
def reset(self, t=250):
"""
Reset is called before each episode begins
Leave blank if nothing needs to happen there
:param t the number of timesteps in the episode
"""
def step(self, obs, reward, done, info):
"""
A single step the agent should take based on the current state of the environment
We will run the Gym environment (AnimalAIEnv) and pass the arguments returned by env.step() to
the agent.
Note that should if you prefer using the BrainInfo object that is usually returned by the Unity
environment, it can be accessed from info['brain_info'].
:param obs: agent's observation of the current environment
:param reward: amount of reward returned after previous action
:param done: whether the episode has ended.
:param info: contains auxiliary diagnostic information, including BrainInfo.
:return: the action to take, a list or size 2
"""
action = [0, 0]
return action