如何修复SimpleObstacleShadowing错误“模块(Veins :: ObstacleControl)中未添加障碍物”

时间:2019-02-10 11:27:54

标签: omnet++ veins

我想在启动仿真工作片刻时模拟一个简单的场景,然后出现以下错误:

Unable to use SimpleObstacleShadowing: No obstacles have been added --     in module (Veins::ObstacleControl) myNet.obstacles (id=2), at t=2.90795546076s, event #103

config.xml文件中的SimpleObstacleShadowing模型:

<AnalogueModel type="SimpleObstacleShadowing">
<parameter name="carrierFrequency" type="double" value="5.890e+9"/> 
 <obstacles>
  <type id="building" db-per-cut="9" db-per-meter="0.4" />
 </obstacles>
</AnalogueModel>

omnetpp.ini文件:

[General]
network = myapp.myNet
debug-on-errors = true
print-undisposed = true
sim-time-limit = 200s
**.scalar-recording = true
**.vector-recording = true
myNet.playgroundSizeX = 2000 m
myNet.playgroundSizeY = 2000 m
myNet.playgroundSizeZ = 30 m
myNet.annotations.draw = true
myNet.connecionManager.coreDebug = true
myNet.connecionManager.sendDirect = true
myNet.connecionManager.maxInterfDist = 1000m
myNet.connecionManager.drawMaxIntfDist = true 
myNet.manager.launchConfig = xmldoc("hello.launchd.xml")
*.obstacles.debug = false
*.obstacles.obstacles = xmldoc("helloConfig.xml",       "//AnalogueModel[@type='SimpleObstacleShadowing']/obstacles")
myNet.node[*].applType = "TraCIDemo11p"
myNet.rsu.applType = "TraCIDemoRSU11p"
myNet.rsu.mobility.x = 200
myNet.rsu.mobility.y = 200
myNet.rsu.mobility.z = 0
myNet.node[*].veinsmobility.x = 0
myNet.node[*].veinsmobility.y = 0
myNet.node[*].veinsmobility.z = 1.895
myNet.*.nic.phy80211p.usePropagationDelay = true
myNet.*.nic.phy80211p.useThermalNoise = true 
myNet.*.nic.phy80211p.thermalNoise = -110dBm
myNet.*.nic.phy80211p.analogueModels = xmldoc("helloConfig.xml")
myNet.*.nic.phy80211p.decider =  xmldoc("helloConfig.xml")
myNet.*.nic.phy80211p.sensitivity = -89dBm
myNet.*.nic.mac1609_4.txPower = 20mW

1 个答案:

答案 0 :(得分:0)

在这种情况下,您没有任何障碍。尝试删除行

*.obstacles.debug = false
*.obstacles.obstacles = xmldoc("helloConfig.xml",       "//AnalogueModel[@type='SimpleObstacleShadowing']/obstacles")

,然后再次运行仿真。 在user documentation中可以找到创建多边形的语法。

根据config.xml的设置,您必须将多边形的type设置为building