eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.53k stars 1.42k forks source link

excludeEmpty="defaults" should write all attributes #12460

Open RobertHilbrich opened 1 year ago

RobertHilbrich commented 1 year ago

Some attributes of unused edges are not part of the meandata output - not even with sensible default values.

Example Consider the following meandata output (excludeEmpty is set to defaults):

<edge id="71028777#3" sampledSeconds="1.36" traveltime="0.03" overlapTraveltime="0.68" density="7.56" laneDensity="7.56" occupancy="0.15" waitingTime="0.00" timeLoss="0.15" speed="7.65" speedRelative="0.55" departed="0" arrived="0" entered="2" left="2" laneChangedFrom="0" laneChangedTo="0"/>
...
<edge id="71595976" sampledSeconds="0.00" traveltime="11.51" speed="5.56" speedRelative="1.00" departed="0" arrived="0" entered="0" left="0" laneChangedFrom="0" laneChangedTo="0"/>

This poses a problem for parse_fast, which (in my setup) expects a density attribute to be present in every edge. If an edge does not come with that attribute, it will be skipped.

SUMO doc says writeAttributes defaults to all attributes - so I would assume a sensible default value is printed for unused edges.

SUMO-version: 1.14.1

operating system: MacOS

behrisch commented 1 year ago

parse_fast already has the optional parameter but I still think it is reasonable to write all attributes if excludeEmpty is set to "defaults".

namdre commented 1 year ago

can this be closed or do we still want to tweak meanData output?

behrisch commented 1 year ago

I would still want to fix this for the meandata