1

I used SUMO to move vehicles and bus nodes on a four-lane road. The source code of my route file is as follows:

<routes>
     <vType id="normal_car" vClass="passenger" maxSpeed="50" speedFactor="0.9" speedDev="0.2" sigma="0.5"/>
     <vType id="mobile_rsu" vClass="bus" maxSpeed="30" speedFactor="1.1" speedDev="0.1" sigma="0.5"/>
     <flow id="normal_car_flow" type="normal_car" begin="0" end="3500" number="500" from="edge0" to="edge2" departPos="random" departLane="random"/>
     <flow id="mobile_rsu_flow" type="mobile_rsu" begin="0" end="5000" number="100" from="edge0" to="edge2" departPos="random" departLane="random"/>
</routes>

I have created a submodule for each node in Scenario.ned.

car[0] : Car
{
     parameters:
          @display("p=100,390;is=s");
}

mrsu[0] : mRSU
{
     parameters:
          @display("p=200,390;is=s");
}

I tried to register the mobile node in omnetpp.ini as follows: (Also I'm using VeinsInetManager.)

*.veinsManager.moduleType = "normal_car=org.car2x.veins.nodes.Car mobile_rsu=org.car2x.veins.nodes.mRSU"
*.veinsManager.moduleName = "normal_car=Car mobile_rsu=mRSU"
*.veinsManager.launchConfig = xmldoc("highway.launchd.xml")
*.veinsManager.host = "localhost"
*.veinsManager.port = 9999 
*.veinsManager.autoShutdown = true
*.veinsManager.updateInterval = 1s

However, the following error occurs when running the simulation. How should I fix it?

Keys of mappings of moduleType and moduleName are not the same..

Minwoo Kim
  • 195
  • 10

1 Answers1

1

I solved the problem.

First of all, I applied this link to my problem.

Using my question, how to register 2 or more nodes in moduleType is as follows.

<routes>
     <vType id="normal_car" vClass="passenger" maxSpeed="50" speedFactor="0.9" speedDev="0.2" sigma="0.5"/>
     <vType id="mobile_rsu" vClass="bus" maxSpeed="30" speedFactor="1.1" speedDev="0.1" sigma="0.5"/>
     <flow id="normal_car_flow" type="normal_car" begin="0" end="3500" number="500" from="edge0" to="edge2" departPos="random" departLane="random"/>
     <flow id="mobile_rsu_flow" type="mobile_rsu" begin="0" end="5000" number="100" from="edge0" to="edge2" departPos="random" departLane="random"/>
</routes>

You can apply the following to omnetpp.ini to recognize nodes in the simulation.

*.veinsManager.moduleType = "mobile_rsu=org.car2x.veins.nodes.mRSU *=org.car2x.veins.nodes.Car"
*.veinsManager.moduleName = "mobile_rsu=mRSU *=Car"
*.veinsManager.launchConfig = xmldoc("highway.launchd.xml")
*.veinsManager.host = "localhost"
*.veinsManager.port = 9999 
*.veinsManager.autoShutdown = true
*.veinsManager.updateInterval = 1s

That's it!

Minwoo Kim
  • 195
  • 10