本文介绍了静脉:获取Tripinfo和排放量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有omnetpp 5.1.1的静脉4.6,并尝试在.sumocfg文件中使用以下配置来输出车辆的tripinfo:

I'm using veins 4.6 with omnetpp 5.1.1 and trying to output tripinfo of vehicles using following configurations in .sumocfg file:

<input>
    <net-file value="erlangen.net.xml"/>
    <route-files value="erlangen.rou.xml"/>
    <additional-files value="erlangen.poly.xml"/>
</input>

<time>
    <begin value="0"/>
    <end value="300"/>
    <step-length value="0.1"/>
</time>

<report>
    <no-step-log value="true"/>
</report>

<gui_only>
    <start value="true"/>
</gui_only>

<emissions>
    <device.emissions.probability value="1"/>
</emissions>

<output>
    <tripinfo-output value="erlangen.trip_info.xml"/>
    <fcd-output value="erlangen.fcd.xml"/>
</output>

我已经生成了例如网络的30个随机行程,并设置了 vType 元素的 emissionClass ="HBEFA3/LDV_G_EU4" 属性.当我直接在SUMO中运行仿真时,一旦成功完成,它将生成所需的行程信息文件:

I have generated 30 random trips for example network, set emissionClass="HBEFA3/LDV_G_EU4" attribute of vType element. When I run simulation directly in SUMO then on successful completion it generates required trip info file:

<tripinfo id="0" depart="0.00" departLane="4006674#0_0" departPos="5.10" departSpeed="0.00" departDelay="0.00" arrival="202.40" arrivalLane="-4006726#0_0" arrivalPos="281.67" arrivalSpeed="13.76" duration="202.40" routeLength="2214.00" waitSteps="0" timeLoss="28.90" rerouteNo="0" devices="tripinfo_0 emissions_0" vType="passenger" speedFactor="1.00" vaporized="">
    <emissions CO_abs="16453.885943" CO2_abs="591255.824603" HC_abs="76.174970" PMx_abs="24.476562" NOx_abs="123.285735" fuel_abs="254.203634" electricity_abs="0"/>
</tripinfo>

...

<tripinfo id="29" depart="29.00" departLane="29900564#4_0" departPos="5.10" departSpeed="0.00" departDelay="0.00" arrival="226.10" arrivalLane="-31241838#0_0" arrivalPos="18.39" arrivalSpeed="22.13" duration="197.10" routeLength="2353.60" waitSteps="0" timeLoss="23.99" rerouteNo="0" devices="tripinfo_29 emissions_29" vType="passenger" speedFactor="1.00" vaporized="">
    <emissions CO_abs="16826.605518" CO2_abs="612826.831847" HC_abs="78.478455" PMx_abs="25.328690" NOx_abs="126.946877" fuel_abs="263.477812" electricity_abs="0"/>
</tripinfo>

但是,当我调试与OMNET ++ Simulation相同的调试器时,它将以以下通知结束,并且不会生成行程信息文件.

But when I debug the same as OMNET++ Simulation then it finishes with following notification and trip info file is not generated.

我在 .sumocfg omnetpp.ini (sim-time-limit = 300s)中将模拟时间设置为300s,屏幕截图显示所有出发的车辆均已到达在285.900 s时,同时通知停止了仿真.通过多次更改随机行程的次数和模拟时间,我多次观察到了这个问题,但徒劳无功.

I set the simulation time to 300s in both .sumocfg and omnetpp.ini (sim-time-limit = 300s), screenshots shows that all departed vehicles were arrived at 285.900 s and at the same time simulation stopped with the notification. I have observed this issue multiple time by changing the number of random trips and simulation time again and again but all in vain.

此处明确指出:

但这不是我的情况.请指导我在做什么错.谢谢

But that is not the case with me. Please guide what i'm doing wrong. Thanks

推荐答案

您最有可能通过sumo-launchd.py运行SUMO,这将创建场景的临时副本(在/tmp中).方案运行后,副本将被删除.这意味着,如果您登录到执行SUMO模拟的目录,则将清除记录的数据以及临时副本.

You most likely ran SUMO via sumo-launchd.py, which creates a temporary copy of your scenario (in /tmp). After the scenario ran, the copy is deleted. This means, if you are logging to the directory that the SUMO simulation is executing in, your logged data will be cleaned along with the temporary copy.

有三种预防方法:

  1. 使用禁止删除临时目录的命令行开关运行sumo-launchd.py,或者

  1. Run sumo-launchd.py with a command line switch that disables deletion of the temporary directory, or

配置SUMO以便将统计信息存储在其他位置,或者

Configure SUMO to store the statistics somewhere else, or

使用另一种方式启动SUMO(手动或使用TraCI ScenarioManagerForker)

Use a different way of launching SUMO (manually or using the TraCI ScenarioManagerForker)

这篇关于静脉:获取Tripinfo和排放量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 15:00