0
votes

I'm use sumo 0.21.0 , omnet++ 4.6 , and Veins 3.0 I'm succeed in connecting my traffic mobility simulation (sumo) with network simulation (omnet++). I have flow of vehicle route in sumo rou file,

 <vType accel="2.0" decel="2.0" id="CarA" length="5.0" maxSpeed="15.0" minGap="2.5" sigma="0" vClass="passenger"/>
<vType accel="2.0" color="0,1,0" decel="2.0" guiShape="bus" id="BUS" length="10" maxSpeed="12.0" minGap="2.5" sigma="0" speedDev="0.1" speedFactor="1.2" vClass="bus"/>

`<flow begin="0" id="Bus1001" period="510" type="BUS" departSpeed="12" departLane="0">
    <route edges="D1"/>
    <stop busStop="busstop1" duration="8.470000284081323"/>
</flow>
<flow begin="0" color="0,0,1" id="car0" period="30" type="CarA" departSpeed="15" departLane="1">
    <route edges="D1"/>
</flow>`

and have 2 types of vehicle BUS and CarA. I want to use sumo vehicle ID as the nodes id in omnet++ and differentiate between vehicle car and bus. I read about adding getExternalId() but I can't find any clear and detail explanation how can it works, and how can I add those code in omnet++

1

1 Answers

3
votes

The class TraCIMobility provides a function to get the external id (which is the SUMO id).

The example application TraCIDemo11p shows how to get the mobility in your application. Then the only thing left to do is to call traci->getExternalId() which returns the id as a string.

Note that this answer is for Veins 3.0. For newer version it works in a similar way.