-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.py
36 lines (28 loc) · 792 Bytes
/
logger.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
from __future__ import division, print_function
class Loggable(object):
"""
Implements an object whose metrics can be logged through
time and accessed as a pandas DataFrame.
"""
def dump(self):
"""
Update an internal log of object data.
"""
raise Exception('Not implemented.')
def get_log(self):
"""
Cast the object's internal log into a pandas DataFrame.
:return: the DataFrame containing the object's log
"""
raise Exception('Not implemented.')
def test():
from highway_env.vehicle.dynamics import Vehicle
r = None
v = Vehicle(r, [0, 0], 0, 20)
v.dump()
v.dump()
v.dump()
v.dump()
print(v.get_log())
if __name__ == '__main__':
test()