How to get the id of edges inside traffic island and intuitive tool for comparing simulator results of SUMO

63 Views Asked by At

1.If I want to get edge IDs of each in list format(python), which function should I use from sumolib? I tried looking for it in sumolib site (https://sumo.dlr.de/pydoc/sumolib.net.html, https://sumo.dlr.de/pydoc/sumolib.net.edge.html) but, the following website does not have good explanation. I might have to try every one by my self.

2.Also, is there an easy way to compare result of two separate simulator scenario intuitively? If there are lots of scenarios, should I make my own python code?

two edges, in yellow box

1

There are 1 best solutions below

2
On BEST ANSWER

To get a list of all edge IDs in a SUMO network you can read the network and then retrieve all edges with the following code:

import sumolib
net = sumolib.net.readNet('myNet.net.xml')
edgeIDs = [e.getID() for e in net.getEdges()]

To compare simulation runs you can use the visualization tools see for instance https://sumo.dlr.de/docs/Tools/Visualization.html#plot_net_dumppy