-
Notifications
You must be signed in to change notification settings - Fork 492
/
agent.py
34 lines (25 loc) · 964 Bytes
/
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
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from habitat.core.simulator import Observations
class Agent:
"""Abstract class for defining agents which act inside Env. This abstract
class standardizes agents to allow seamless benchmarking. To implement an
agent the user has to implement two methods:
reset
step
"""
def reset(self) -> None:
"""Called before starting a new episode in environment.
"""
raise NotImplementedError
def act(self, observations: Observations) -> int:
"""
Args:
observations: observations coming in from environment to be used
by agent to decide action.
Returns:
action to be taken inside the environment
"""
raise NotImplementedError