【问题标题】:How to simulate 1000 vehicles in veins/omnet?如何在静脉/omnet 中模拟 1000 辆汽车?
【发布时间】:2016-07-15 14:33:50
【问题描述】:

我尝试在 Veins erlangen 示例中模拟 1000 辆汽车。但模拟器总是停止大约 700 辆车并显示错误消息。我可以模拟 500 辆汽车。为什么我不能模拟 1000 辆汽车?

运行时错误。即将抛出 cRuntimeError 异常,并且 您要求(通过在 ini 文件中设置 debug-on-errors=true ) 错误中止执行并进入调试器。

您现在应该在 gdb 或其他环境下运行模拟 调试器。模拟内核现在将发出一个 SIGABRT 信号,该信号 会让你进入调试器。如果您没有在 调试器,您仍然可以使用核心转储进行事后调试。 进入调试器后,查看调用堆栈(在 gdb:“bt”命令中)以 查看运行时错误的上下文。

模块中的错误 (Veins::TraCIScenarioManagerLaunchd) RSUExampleScenario.manager (id=6) 在事件 #21128,t=2112.7: std::bad_alloc: std::bad_alloc。

<pre>
[General]
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s

#tkenv-default-config = debug
#tkenv-default-run = 1
ned-path = .

network = RSUExampleScenario

##########################################################
#            Simulation parameters                       #
##########################################################
debug-on-errors = true
print-undisposed = false

#sim-time-limit = 6000s
sim-time-limit = 8000s

**.scalar-recording = true
**.vector-recording = true

**.debug = false
**.coreDebug = false

*.playgroundSizeX = 2500m
*.playgroundSizeY = 2500m
*.playgroundSizeZ = 50m
#*.playgroundSizeX = 7500m #ME ADDED
#*.playgroundSizeY = 7500m #ME ADDED
#*.playgroundSizeZ = 500m #ME ADDED


##########################################################
# Annotation parameters                                  #
##########################################################
*.annotations.draw = false

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

##########################################################
#            WorldUtility parameters                     #
##########################################################
*.world.useTorus = false
*.world.use2D = false

##########################################################
#            TraCIScenarioManager parameters             #
##########################################################
*.manager.updateInterval = 0.1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.moduleType = "org.car2x.veins.nodes.Car"
*.manager.moduleName = "node"
*.manager.moduleDisplayString = ""
*.manager.autoShutdown = true
*.manager.margin = 25
*.manager.launchConfig = xmldoc("erlangen.launchd.xml")

##########################################################
#                       RSU SETTINGS                     #
#                                                        #
#                                                        #
##########################################################
*.rsu[0].mobility.x = 2000
*.rsu[0].mobility.y = 2000
*.rsu[0].mobility.z = 3
*.rsu[*].applType = "TraCIDemoRSU11p"
*.rsu[*].appl.debug = false
*.rsu[*].appl.headerLength = 256 bit
*.rsu[*].appl.sendBeacons = false
*.rsu[*].appl.dataOnSch = false
*.rsu[*].appl.sendData = true
*.rsu[*].appl.beaconInterval = 1s
*.rsu[*].appl.beaconPriority = 3
*.rsu[*].appl.dataPriority = 2
*.rsu[*].appl.maxOffset = 0.005s


##########################################################
#            11p specific parameters                     #
#                                                        
# NIC-Settings                        #
##########################################################
*.connectionManager.pMax = 20mW
*.connectionManager.sat = -89dBm
*.connectionManager.alpha = 2.0
*.connectionManager.carrierFrequency = 5.890e9 Hz
*.connectionManager.sendDirect = true

*.**.nic.mac1609_4.useServiceChannel = false

*.**.nic.mac1609_4.txPower = 20mW
*.**.nic.mac1609_4.bitrate = 18Mbps

*.**.nic.phy80211p.sensitivity = -89dBm
*.**.nic.phy80211p.useThermalNoise = true
*.**.nic.phy80211p.thermalNoise = -110dBm
*.**.nic.phy80211p.decider = xmldoc("config.xml")
*.**.nic.phy80211p.analogueModels = xmldoc("config.xml")
*.**.nic.phy80211p.usePropagationDelay = true

##########################################################
#                    WaveAppLayer                        #
##########################################################
*.node[*].applType = "TraCIDemo11p"
*.node[*].appl.debug = false
*.node[*].appl.headerLength = 256 bit
*.node[*].appl.sendBeacons = false
*.node[*].appl.dataOnSch = false
*.node[*].appl.sendData = true
*.node[*].appl.beaconInterval = 1s
*.node[*].appl.beaconPriority = 3
*.node[*].appl.dataPriority = 2
*.node[*].appl.maxOffset = 0.005s

##########################################################
#                      Mobility                          #
##########################################################
*.node[*].veinsmobilityType =      "org.car2x.veins.modules.mobility.traci.TraCIMobility"
*.node[*].mobilityType = "TraCIMobility"
*.node[*].mobilityType.debug = true
*.node[*].veinsmobilityType.debug = true
*.node[*].veinsmobility.x = 0
*.node[*].veinsmobility.y = 0
*.node[*].veinsmobility.z = 1.895
#*.node[*0].veinsmobility.accidentCount = 0
#*.node[*0].veinsmobility.accidentStart = 75s
#*.node[*0].veinsmobility.accidentDuration = 30s
*.node[5].veinsmobility.accidentCount = 0
*.node[5].veinsmobility.accidentStart = 15s
*.node[5].veinsmobility.accidentDuration = 35s
*.node[10].veinsmobility.accidentCount = 0
*.node[10].veinsmobility.accidentStart = 35s
*.node[10].veinsmobility.accidentDuration = 35s

[Config nodebug]
description = "default settings"
**.debug = false
**.coreDebug = false
*.annotations.draw = false

[Config debug]
description = "(very slow!) draw and print additional debug information"
**.debug = true
**.coreDebug = true
*.annotations.draw = true

</pre>

【问题讨论】:

  • 幸运的是,SO 中充满了心灵感应器,他们可以读出你的想法,你的代码是什么,这些错误消息是什么,因此他们可以回答它,而不需要你再写 5 行。
  • 顺便说一句,我试图通过修复它的拼写来保存你的问题,但下次你不会那么幸运,你的问题将被简单地关闭。如果您不确定最常见和最烦人的拼写错误是什么,here 对您来说是一个简单的检查清单。并在此处粘贴您的代码,也粘贴错误消息,并快速完成,否则您的问题将被关闭!
  • 好的,我会尽快上传错误信息。非常感谢

标签: omnet++ veins


【解决方案1】:

看来您的内存不足。根据粗略计算,Veins 需要大约 400 KB 的内存来模拟每辆车。这意味着,您需要 400 MB 的内存来模拟 1000 辆汽车——如果您运行图形用户界面,则需要更多的内存。

据此,对于您的问题,我可以得出两个可能的答案:首先,在命令行模式下运行您的模拟(有关如何执行此操作,请参阅用户手册)。其次,确保您至少有 0.4 GB 的可用主内存。

【讨论】:

  • 克里斯博士,非常感谢
【解决方案2】:

一旦我生成地图以模拟更多车辆并且它可以工作,我曾经在命令中增加结束时间 f.g. python c:\sumo\sumo25\tools\randomTrips.py -n map.net.xml -e 200 -l

【讨论】:

    猜你喜欢
    • 2018-09-23
    • 2012-05-20
    • 1970-01-01
    • 2018-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-05
    • 1970-01-01
    相关资源
    最近更新 更多