return np.array([[self.vehicles[vehicle]["speed"],
self.vehicles[vehicle]["lane"],
// self.vehicles[vehicle]["absolute_position"],
self.get_headway(vehicle, lane=abs(self.vehicles[vehicle]["lane"]-1)), // adjacent-lane head
self.get_headway(vehicle)] for vehicle in self.vehicles]).T // current lane head
def render(self):
After Change
return np.array([[self.vehicles[vehicle]["speed"],
self.vehicles[vehicle]["lane"],
self.vehicles[vehicle]["absolute_position"],
self.timer - self.vehicles[vehicle]["last_lc"]] for vehicle in self.vehicles]).T
// self.get_headway(vehicle, lane=abs(self.vehicles[vehicle]["lane"]-1)), // adjacent-lane head
// self.get_headway(vehicle)] for vehicle in self.vehicles]).T // current lane head