Converter module

used for converting SUMO file to CityFlow file.

Converter.calc_edge_compass_angle(edge)
Parameters

edge

Returns

Converter.calc_edge_compass_angle_no_modify(edge)
Parameters

edge

Returns

Converter.cityflow2sumo_cfg(args)

generate sumo cfg file

Parameters

args

Returns

Converter.cityflow2sumo_flow(args)
Parameters

args

Returns

Converter.cityflow2sumo_net(args)

generate net.xml according to nod.xml, edg.xml,con.xml,tll.xml

Parameters

args

Returns

Converter.fill_empty_phase(current_phase, count)
Parameters
  • current_phase

  • count

Returns

Parameters
  • roadLinks

  • lane_id

Returns

Parameters
  • roadLinks

  • edge

  • turntype

Returns

Converter.find_edges_by_angle(all_edges, angle)
Parameters
  • all_edges

  • angle

Returns

Converter.find_edges_by_cluster_centroid(all_edges, angle)
Parameters
  • all_edges

  • angle

Returns

Parameters

roadLinks

Returns

Converter.get_direction_fron_connection(connection)
Parameters

connection

Returns

Converter.get_filename(netfile, typ='', need_path=True)

:type net,nod,edg,tll,rou,sumocfg :param netfile: :param typ: :param need_path: :return:

Converter.get_final_intersections(net, tls_dict, edge_dict)
Parameters
  • net

  • tls_dict

  • edge_dict

Returns

Converter.get_final_roads(net)
Parameters

net

Returns

Converter.get_phase2lane(direction, typ, num_phase)

return the idx of phase_idx related to roadlink_idx. In SUMO, the phase are ordered by clockwise, from N_r_s_l to W_r_s_l, totally 12 dims or 8dims.

Parameters
  • direction

  • typ

  • num_phase

Returns

Converter.group_connections_by_start_end(connections)
Parameters

connections

Returns

Converter.node_to_intersection(node, tls_dict, edge_dict)
Parameters
  • node

  • tls_dict

  • edge_dict

Returns

Converter.parse_args()
Returns

Converter.point_tuple_to_dict(point_tuple)
Parameters

point_tuple

Returns

Converter.process_edge(edge)
Parameters

edge

Returns

Converter.process_intersection_simple_phase(intersection)
Parameters

intersection

Returns

Converter.sumo2cityflow_flow(args)
Parameters

args

Returns

Converter.sumo2cityflow_net(args)
Parameters

args

Returns