smarts.sstudio.generators module
- exception smarts.sstudio.generators.InvalidRoute[source]
An exception given if a route cannot be successfully plotted.
- class smarts.sstudio.generators.RandomRouteGenerator(road_map: RoadMap)[source]
Generates a random route out of the routes available in the road map.
- Parameters:
road_map – A network of routes defined for vehicles of different kinds to travel on.
- class smarts.sstudio.generators.TrafficGenerator(scenario_dir: str, scenario_map_spec: MapSpec | None, log_dir: str | None = None, overwrite: bool = False)[source]
Generates traffic from scenario information.
- plan_and_save(traffic: Traffic, name: str, output_dir: str | None = None, seed: int = 42)[source]
Writes a traffic spec to a route file in the given output_dir.
traffic: The traffic to write out name: The name of the traffic resource file output_dir: The output directory of the traffic file seed: The seed used for deterministic random calls
- resolve_edge_length(edge_id, lane_idx)[source]
Determine the length of the given lane on an edge. :param edge_id: The edge id of the road segment. :param lane_idx: The index of a lane.
- Returns:
The length of the lane (same as the length of the edge.)
- resolve_route(route, fill_in_gaps: bool) Route [source]
Attempts to fill in the route between the beginning and end specified in the initial route.
- Parameters:
route – An incomplete route.
- Returns:
A complete route listing all road segments it passes through.
- Return type:
- property road_network
Retrieves the road network this generator is associated with.