我正在尝试在omnet ++ 5.0中使用静脉4.4运行一个最小的项目。使用本指南:https://github.com/burtonwilliamt/carlogicapi/tree/master/tutorials/VeinsTutorial我设法使其示例运行。
然后,我用自己(非常简单)的相扑网制作自己(非常相似)的版本。但是当我运行这个项目时,我得到了错误:
<!> Error in module (Veins::TraCIScenarioManagerLaunchd) CircleScenario.manager (id=6) at event #2, t=0.1: ASSERT: condition omnetTimestep == serverTimestep false in function processSimSubscription, veins/modules/mobility/traci/TraCIScenarioManager.cc line 724.
有人知道为什么会发生此错误吗?
此项目中没有自定义C ++代码,只有omnetpp.ini,相扑xml文件和方案。
场景:
package circle;
import org.car2x.veins.nodes.Scenario;
network CircleScenario extends Scenario
{
//inherited from Scenario
connections allowunconnected:
}
omnetpp.ini:
[General]
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s
#ned-path = ..
debug-on-errors = true
network = circle.CircleScenario # the package where the Scenario is
##### Simulation Parameters ######
# * means TutorialScenario at the begginning
#sim-time-limit = 1000s
#tkenv-image-path = path/to/background/image.png
*.playgroundSizeX = 1000m
*.playgroundSizeY = 1000m
*.playgroundSizeZ = 50m
##### TraCIScenarioManager Parameters ######
*.manager.updateInterval = 0.1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.autoShutdown = false
*.manager.moduleType = "org.car2x.veins.nodes.Car"
*.manager.moduleName = "node"
*.manager.moduleDisplayString = ""
*.manager.launchConfig = xmldoc("circle.launchd.xml")
##### IEEE 802.11p Wireless Parameters #######
*.connectionManager.pMax = 20mW
*.connectionManager.sat = -89dBm
*.connectionManager.alpha = 2.0
*.connectionManager.carrierFrequency = 5.890e9 Hz
*.connectionManager.sendDirect = true
*.node[*].nicType = "Nic80211p"
*.**.nic.mac1609_4.txPower = 20mW
*.**.nic.mac1609_4.bitrate = 18Mbps
*.**.nic.phy80211p.sensitivity = -89dBm
*.**.nic.phy80211p.useThermalNoise = true
*.**.nic.phy80211p.thermalNoise = -110dBm
*.**.nic.phy80211p.usePropagationDelay = true
##### Car Parameters #####
# Application Parameters
# Mobility Parameters
*.node[*].veinsmobilityType =
"org.car2x.veins.modules.mobility.traci.TraCIMobility"
*.node[*].veinsmobility.x = 0
*.node[*].veinsmobility.y = 0
*.node[*].veinsmobility.z = 0
**.debug = true
**.coreDebug = true
编辑:相扑文件:
circle.edg.xml:
<!-- filename: circle.edg.xml -->
<edges>
<edge from="1" id="1to2" to="2" />
<edge from="2" id="2to3" to="3" />
<edge from="3" id="3to4" to="4" />
<edge from="4" id="out" to="5" />
</edges>
circle.launchd.xml
<?xml version="1.0"?>
<!-- debug config -->
<launch>
<copy file="circle.net.xml" />
<copy file="circle.rou.xml" />
<copy file="circle.settings.xml" />
<copy file="circle.sumo.cfg" type="config" />
</launch>
circle.nod.xml
<!-- filename: circle.nod.xml -->
<nodes>
<node id="1" x="-100.0" y="-100.0" />
<node id="2" x="-100.0" y="+100.0" />
<node id="3" x="+100.0" y="+100.0" />
<node id="4" x="+100.0" y="-100.0" />
<node id="5" x="+101.0" y="-100.0" />
</nodes>
circle.rou.xml:
<!-- filename: circle.rou.xml -->
<routes>
<vType accel="1.0" decel="5.0" id="Car" length="2.0" maxSpeed="30.0" sigma="0.0" />
<route id="route0" edges="1to2 2to3 3to4 out"/>
<vehicle depart="10" id="veh0" route="route0" type="Car" />
</routes>
circle.settings.xml
<!-- filename: circle.settings.xml -->
<viewsettings>
<viewport y="100" x="100" zoom="100"/>
<delay value="100"/>
</viewsettings>
circle.sumo.cfg
<!-- filename: circle.sumo.cfg -->
<configuration>
<input>
<net-file value="circle.net.xml"/>
<route-files value="circle.rou.xml"/>
</input>
<time>
<begin value="0"/>
<end value="10000"/>
</time>
</configuration>
网络文件有点长,所以我不会发布它,但是它是使用相扑0.25生成的:
netconvert --node-files=circle.nod.xml --edge-files=circle.edg.xml --output-file=circle.net.xml
答案 0 :(得分:1)
SUMO的默认步长设置为1秒。发生此错误是因为通过在omnetpp.ini文件中设置*.manager.updateInterval = 0.1s
为OMNeT ++仿真设置了不同的步长。您还需要为SUMO配置添加步长。这可以通过在XML结构的<step-length value="0.1"/>
元素中添加<time>
来完成。
结果应如下所示:
<configuration>
<input>
<net-file value="circle.net.xml"/>
<route-files value="circle.rou.xml"/>
</input>
<time>
<begin value="0"/>
<end value="10000"/>
<step-length value="0.1"/>
</time>
</configuration>