A class to represent an observation of the traffic environment. Attributes: vehicles (List[Vehicle]): A list of Vehicle objects in the environment. history_track (Dict[int, List[State]]): A dictionary mapping vehicle IDs to their historical sta
| 11 | |
| 12 | |
| 13 | class Observation: |
| 14 | """ |
| 15 | A class to represent an observation of the traffic environment. |
| 16 | |
| 17 | Attributes: |
| 18 | vehicles (List[Vehicle]): |
| 19 | A list of Vehicle objects in the environment. |
| 20 | history_track (Dict[int, List[State]]): |
| 21 | A dictionary mapping vehicle IDs to their historical state trajectories. |
| 22 | obstacle (List[List[State]]): |
| 23 | A list of lists containing Static obstacles in the environment |
| 24 | """ |
| 25 | |
| 26 | def __init__(self, |
| 27 | vehicles: List[Vehicle] = None, |
| 28 | history_track: Dict[int, List[State]] = None, |
| 29 | static_obstacles: List[StaticObstacle] = None) -> None: |
| 30 | self.vehicles: List[Vehicle] = vehicles if vehicles is not None else [] |
| 31 | self.history_track: Dict[int,List[State]] = history_track if history_track is not None else {} |
| 32 | self.obstacles: List[StaticObstacle] = static_obstacles if static_obstacles is not None else [] |