Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Can you clarify how density is computed for lanes and edges

According to the wiki (http://sumo.dlr.de/wiki/Simulation/Output/Lane-_or_Edge-based_Traffic_Measures)
density is given as "#veh/km"
However, looking at the source in MSMeanData_Net line 179 and 208 it is computed as


dev.writeAttr("density", sampleSeconds / STEPS2TIME(period) * (SUMOReal) 1000 / myLaneLength)

I cannot see why the above gives the number of vehicles per Km in the lane during the period. As far as I see, sampleSeconds is updated as expected
sampleSeconds += timeOnLane
so it seems to be what the wiki says "Number seconds vehicles were measured on the edge/lane".
It seems that we have the fraction of time the lane has been occupied multiplied by 1000  and divided by the lane length.
Is this an error or is this coming from some formula I do not know of?

Back to the top