smarts.core.traffic_provider module

class smarts.core.traffic_provider.TrafficProvider[source]

A TrafficProvider is a Provider that controls/owns a (sub)set of vehicles that all share the same action space.

destroy()[source]

Clean up any connections/resources.

reserve_traffic_location_for_vehicle(vehicle_id: str, reserved_location: Polygon)[source]

Reserve an area around a location where vehicles cannot spawn until a given vehicle is added. :param vehicle_id: The vehicle to wait for. :param reserved_location: The space the vehicle takes up.

route_for_vehicle(vehicle_id: str) Route | None[source]

Gets the current Route for the specified vehicle, if known.

update_route_for_vehicle(vehicle_id: str, new_route: Route)[source]

Set a new route for the given vehicle.

vehicle_collided(vehicle_id: str)[source]

Called when a vehicle this provider manages is detected to have collided with any other vehicles in the scenario.

vehicle_dest_road(vehicle_id: str) str | None[source]

Get the final road_id in the route of the given vehicle.