In sumo, vehicle routes are organized around roads (or rather edges) rather than junctions. If you can rephrase your problem in terms of edges the the solution becomes quite simple.
edges = traci.vehicle.getRoute(vehID) remainingEdges = edges[traci.vehicle.getRouteIndex(vehID):] then for each of the remaining edges you can compute the traveltime to your destination (edge) Z stage = traci.simulation.findRoute(fromEdge, toEdge) travelTime = stage.travelTime If you need to do the same thing with junctions, then you can use sumolib ( http://sumo.dlr.de/wiki/Tools/Sumolib) to read the network graph of edges and junctions. This allows you to identify the target junction for each of the remaining edges (edge.getToNode()). You then just need to pick a suitable target edge from all edges that are incoming to your target junction Z (node.getIncoming()). regards, Jakob Am Do., 10. Jan. 2019 um 10:39 Uhr schrieb Arslane Hamza Cherif < arslane.hamzache...@gmail.com>: > Hello Dear sumo-dev, > > First of all, excuse me if I am missing something or doing it wrong, it is > the first time that I contribute to an open-source project, but of course > not the first time that I use SUMO, > > In fact, I had worked during the six last years with SUMO and Veins, and I > really appreciate these tools, 2 years ago I was looking for a solution to > my problem, and I realised that It was impossible with an old version of > SUMO, so I switched to a solution based on Python, SumoLib and Networkx API. > > Now lets me explain the problem, and how I think that is possible to solve > it (I will appreciate any help in this sense, to guide me for my first > contribution) > > *Problem:* Say for instance that you have a VehX that follows a specific > route that is passing by multiple junctions (e.g: Junctions: A, B, C, D), > what I want is to identify the closest one relative to another junction Z > that is not in the current route of the vehicle. I asked the question two > years ago here: https://sourceforge.net/p/sumo/mailman/message/35079189/ > > However, at that time I was using an old version of SUMO that does not > include the command *(0x83)* ( > http://sumo.dlr.de/wiki/TraCI/Simulation_Value_Retrieval) > > Maybe it is possible to implement a new command that will achieve this by: > > 1. Identifying the junctions in a current route of VehX > 2. Computing the driving distance (or air distance if needed) between > junctions (A,Z), (B,Z), (C,Z) & (D,Z) > 3. Returning the junction with the shortest distance among the 4 > junctions > > So, any advice on how I can do it ? from where can I start? > > Thank you very much for your time, > > Best Regards, > Arslane HAMZA-CHERIF > > Le mer. 9 janv. 2019 à 10:55, Arslane Hamza Cherif <hc.arsla...@gmail.com> > a écrit : > >> Hello Dear sumo-dev, >> >> First of all, excuse me if I am missing something or doing it wrong, it >> is the first time that I contribute to an open-source project, but of >> course not the first time that I use SUMO, >> >> In fact, I had worked during the six last years with SUMO and Veins, and >> I really appreciate these tools, 2 years ago I was looking for a solution >> to my problem, and I realised that It was impossible with an old version of >> SUMO, so I switched to a solution based on Python, SumoLib and Networkx API. >> >> Now lets me explain the problem, and how I think that is possible to >> solve it (I will appreciate any help in this sense, to guide me for my >> first contribution) >> >> *Problem:* Say for instance that you have a VehX that follows a specific >> route that is passing by multiple junctions (e.g: Junctions: A, B, C, D), >> what I want is to identify the closest one relative to another junction Z >> that is not in the current route of the vehicle. I asked the question two >> years ago here: https://sourceforge.net/p/sumo/mailman/message/35079189/ >> >> However, at that time I was using an old version of SUMO that does not >> include the command *(0x83)* ( >> http://sumo.dlr.de/wiki/TraCI/Simulation_Value_Retrieval) >> >> Maybe it is possible to implement a new command that will achieve this by: >> >> 1. Identifying the junctions in a current route of VehX >> 2. Computing the driving distance (or air distance if needed) between >> junctions (A,Z), (B,Z), (C,Z) & (D,Z) >> 3. Returning the junction with the shortest distance among the 4 >> junctions >> >> So, any advice on how I can do it ? from where can I start? >> >> Thank you very much for your time, >> >> Best Regards, >> Arslane HAMZA-CHERIF >> > _______________________________________________ > sumo-dev mailing list > sumo-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://www.eclipse.org/mailman/listinfo/sumo-dev >
_______________________________________________ sumo-dev mailing list sumo-dev@eclipse.org To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-dev