Hi everyone,
I just stumbled across some error sumolib.net.Net.getLane (SVN revision
20629):
The regular expression used to identify the components of the lanes does
not match some correct lane ids, e.g.,
"-8561890#1_1" yields edge_id "-8561890#1_1" and lane_index = ""
Ids of internal lanes within clusters do not match at all, e.g.,
":cluster_25239123_415913861_0_0"
In addition, iterating over all known edges to find the matching one via
a for loop (line 210) is highly inefficient, as we do have the getEdge
function (or the _id2edge field beneath it).
A simple alternative would be:
def getLane(self, laneID):
split = laneID.rsplit("_")
edge_id = "_".join(split[:-1])
lane_index = int(split[-1])
edge = self.getEdge(edge_id)
return edge.getLane(lane_index)
This should work with all sorts of lane ids as it only focuses on the
last underscore in the id which should always be generated by
sumo/netconvert itself.
Kind regards,
Dominik
--
Dominik Buse M.Sc.
Distributed Embedded Systems (CCS Labs)
Heinz Nixdorf Institut, Paderborn University, Germany
http://www.ccs-labs.org/~buse/
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
sumo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-devel