Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
293 views
in Technique[技术] by (71.8m points)

omnet++ - Veins Multiple Applications in multiples Vehicle types

in my simulation using OMNeT++, Veins, and SUMO i want run multiple applications according to their vehicle type, as specified in the .rou.xml file using type="XXX"

For example:

  • <vehicle ... type="private" ... > runs APP_private (using something like *.node[*].applType ="APP_private")
  • <vehicle ... type="bus" ... > runs APP_bus (using something like *.node[*].applType ="APP_bus")

How can I define this in omnetpp.ini?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Veins 4.6 allows you to set any or all of the moduleType, moduleName, and moduleDisplayString parameters not just to a string (which will set the OMNeT++ module type, module name, and module display string to instantiate for every vehicle driving in the configured region of interest, respectively):

You can also set the moduleType, moduleName, and moduleDisplayString parameters to what Veins calls a mapping. This will use different parameter values for different SUMO vehicle types.

The full details can be found in the source code here or on the Veins website. Here's the short version:

  • "a" : assign value "a" to all nodes (for backward compatibility)
  • "a=b : assign value "b" to vehicle type "a". the presence of any other vehicle type in the simulation will cause the simulation to stop
  • "a=b c=d : assign value "b" to vehicle type "a" and "d" to "c". the presence of any other vehicle type in the simulation will cause the simulation to stop
  • "a=b c=d *=e": everything which is not of vehicle type "a" or "b", assign value "e"

A module type of "0" means to not instantiate this module.

In your specific case, it seems like it should be sufficient to use *.manager.moduleName = "XXX=busNode *=node" and to configure *.busNode[*].applType = "APP_bus" and *.node[*].applType = "APP_private".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...