-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjourney_pointer.py
37 lines (29 loc) · 1.38 KB
/
journey_pointer.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
from datetime import datetime
from typing import Optional
from connections import Connection, Footpath
class JourneyPointer(object):
"""
Pointers used to reconstruct the journey from the source to the sink
Attributes:
- :class:`datetime` arrival_time --> The latest time at which someone can
arrive at the stop to make the connection.
- :class:`Optional[Connection]` enter_connection --> If none, then this
journey is a simple walk from a node to the sink. Otherwise, this is
the connection from the
- :class:`Optional[Connection]` exit_connection --> The name of the test object
- :class:`Footpath` footpath --> The name of the test object
"""
def __init__(self,
arrival_time: datetime,
enter_connection: Optional[Connection],
exit_connection: Optional[Connection],
footpath: Optional[Footpath]):
self.arrival_time = arrival_time
self.enter_connection = enter_connection
self.exit_connection = exit_connection
self.footpath = footpath
def __repr__(self):
return f'<JourneyPointer ({self.arrival_time.time()}, {self.enter_connection}, ' \
f'{self.exit_connection}, {self.footpath})>'
def __str__(self):
return f'({self.arrival_time.time()}, {self.enter_connection}, {self.exit_connection}, {self.footpath})'