I am new to OMNeT++. I'm using OMNeT++ 5.1.1, SuMO 0.30.0, and veins 4.7.1. i need to apply the Dijkstra algorithm to vehicles for finding the shortest path to the destination. i can get the list of all junctions from the map.net.xml file using TraCICommandInterface::getJunctionIds() function. But how can i get the list of all junctions connected to the given junction? please help me. Thank you
Asked
Active
Viewed 201 times
1 Answers
0
The easiest is probably to parse the network (using an XML parser of your choice or sumolib if you want to use python) and then retrieve the information from the network directly. Every junction element has an id in the network and the edge elements have "from" and "to" attributes denoting source and destination. If you use sumolib, here is sample code: https://sumo.dlr.de/wiki/Tools/Sumolib#import_a_network_and_retrieve_nodes_and_edges

Michael
- 3,510
- 1
- 11
- 23
-
Thank you Sir for your response. i will try it – Baram Apr 20 '19 at 17:14