if not isinstance(veh_id, str):
return [self.__vehicles[vehID]["headway"] for vehID in veh_id]
elif veh_id == "all":
return [self.__vehicles[vehID]["headway"] for vehID in self.__ids]
else:
return self.__vehicles[veh_id]["headway"]
After Change
Returns the headway of the specified vehicle(s). If the vehicle is
not found, return -1001.
if isinstance(veh_id, list):
return [self.get_headway(vehID) for vehID in veh_id]
return self.__vehicles.get(veh_id, {}).get("headway", -1001)
def set_lane_headways(self, veh_id, lane_headways):