I have imported a map from OpenStreetMap and created a random trips simulation using randomTrips.py on SUMO. I have generated the following xml files: trips.trips, map.edg, map.nod, map.typ, map.con, map.rou, map.net etc.
In my map.rou files, the random routes are like this:
<routes>
<vehicle id="1" depart="1.00">
<route edges="-96032438#1 -503206455#0 -158581488#10 -158581488#9 -158581488#8 -158581488#7 -158581488#6 -158581488#5 -158581488#4 -158581488#3 -158581488#2 -158581488#1 -158581488#0 -509940347#1 -509940347#0"/>
</vehicle>
...
</routes>
The vehicles (random cars on the road) pass through these edges and the simulation works fine.
But I want to create a vehicle (emergency ambulance) that has a starting edge (I will input the hospital edge) and an ending edge (I will input the accident spot edge) only, and SUMO finds the best edges through Dijkstra's algorithm. How do I not pre-write all the edges?
So far, I have this:
<routes>
<vType id="emergency" vClass="emergency" accel="0.8" decel="4.5" maxSpeed="70" guiShape="emergency">
<param key="has.bluelight.device" value="true"/>
</vType>
<vehicle id="2" type="emergency" depart="2.00">
<route edges="503206454#3 28890299#1 28890299#2 28890299#3 28890299#4 503507632#3 503507632#4 503507632#5 -509972419 28845613 498408593 498408592#0 498408592#1 498408592#2 498404785#2"/>
</vehicle>
</routes>
Note: When I do "sumo -c map.sumo.cfg" in cmd, it returns "Step #10000.00 (0ms ?*RT. ?UPS, vehicles TOT 994 ACT 0 BUF 0)" but when I open the network in sumo-gui, it works fine.
Where do I input the depart and arrival edge for the ambulance? Do I have to create a specific flow just for it or do I input it in the .rou file without the edges?
Please help. Thank you.
CodePudding user response:
SUMO can handle trips directly in your route file (no need to use duarouter). So putting
<trip id="976" type="emergency" depart="976.00" from="498404785#2" to="28890312#14"/>
directly in the routes should work.