mosstool.map.sumo.map¶
Module Contents¶
Classes¶
Data¶
API¶
- mosstool.map.sumo.map.__all__¶
[‘MapConverter’]
- class mosstool.map.sumo.map.MapConverter(net_path: str, default_lane_width: float = 3.2, green_time: float = 60.0, yellow_time: float = 5.0, poly_path: Optional[str] = None, additional_path: Optional[str] = None, traffic_light_path: Optional[str] = None, traffic_light_min_direction_group: int = 3, merge_aoi: bool = False, enable_tqdm: bool = False, multiprocessing_chunk_size: int = 500, traffic_light_mode: Union[Literal[green_red], Literal[green_yellow_red], Literal[green_yellow_clear_red]] = 'green_yellow_clear_red', workers: int = cpu_count())¶
Initialization
Args:
net_path (str): The path to the SUMO road net file.
default_lane_width (float): default lane width
green_time (float): green time
yellow_time (float): yellow time
poly_path (str): The path to the SUMO aois and pois file.
additional_path (str): The path to the SUMO additional file.
traffic_light_path (str): The path to the SUMO traffic-light file.
traffic_light_min_direction_group (int): minimum number of lane directions for traffic-light generation
merge_aoi (bool): merge nearby aois
enable_tqdm (bool): when enabled, use tqdm to show the progress bars
multiprocessing_chunk_size (int): the maximum size of each multiprocessing chunk
traffic_light_mode (str): fixed time traffic-light generation mode.
green_redmeans only green and red light will be generated,green_yellow_redmeans there will be yellow light between green and red light,green_yellow_clear_redadd extra pedestrian clear red light.workers (int): number of workers
- _connect_lane(in_uid, out_uid, orig_lid, lane_turn, lane_type, junc_id, max_speed)¶
Connect two lanes
- _create_junctions()¶
Reconstruct the junction based on the original SUMO road network connection relationship
- _add_lane_conn()¶
Add connections outside the junction
- _add_junc_lane_overlaps()¶
add overlap for junction lanes
- _add_driving_lane_group()¶
Clustering lane groups from the lanes at the junction
- _add_traffic_light()¶
- _get_output_map()¶
Post-processing converts map data into output format
- _add_aois_to_map()¶
- convert_map()¶
- get_sumo_id_mappings()¶
return sumo original id -> uid mappings