Veins: Get Tripinfo and emissions in output

爱⌒轻易说出口 提交于 2020-02-06 03:32:23

问题


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>

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>

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

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.

Here it is clearly stated that:

The information is generated for each vehicle as soon as the vehicle arrived at its destination and is removed from the network.

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


回答1:


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.

There are three ways of preventing that:

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

  2. Configure SUMO to store the statistics somewhere else, or

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



来源:https://stackoverflow.com/questions/50258886/veins-get-tripinfo-and-emissions-in-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!