Hello,
I believe that I have got these covered. I am also careful not to count
twice the same road on lane change.
A minimum working example in Python 2 is attached. It contains recorded
trip of the vehicle '0FRtoLU.0' in latest LuST plus a few lines of code
that expose the problem I am having.
Thank you Jakob,
Matej.
On 27/03/2017 16:02, Jakob Erdmann wrote:
Hello,
the simulation uses the lane lengths from the net.xml. Possible
sources of discrepancy:
- forgetting to count the lengths of internal lanes (lanes within
intersections)
- distance traveled in the last stop before leaving the network (i.e.
the vehicle travles 20m/s in the last step but only drives 10m in the
network and then the route ends)
- integration method to compute distance from speed: By default sumo
uses Euler integration. This means the speed in each step is converted
directly into distance. You may activate ballistic integration using
the option --step-method.ballistic which computes distances from the
average of the speed before and after the step.
If none of the above serve as an explanation I do need a (preferably
short) error example with input files.
regards,
Jakob
2017-03-27 14:00 GMT+02:00 Matěj Kubička
<[email protected]
<mailto:[email protected]>>:
Hello,
Is it possible that lane lengths (extracted from the .net.xml
file) are
not the ones that SUMO uses in simulation? If I compute vehicle travel
distance based on sum of lane-lengths I get quite a different distance
than when I integrate over the speed profile..
What causes these differences? Do you need a working example?
Thanks in advance,
Matej.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sumo-user mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/sumo-user
<https://lists.sourceforge.net/lists/listinfo/sumo-user>
lane = ['-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0_0', '-32426#0-AddedOffRampEdge_1', '-32426#0-AddedOffRampEdge_1', '-32426#0-AddedOffRampEdge_1', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#1_0', '-32426#2-AddedOnRampEdge_1', '-32426#2-AddedOnRampEdge_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_1', '-32426#2_0', '-32426#2_0', '-32426#2_0', '-32426#2_0', '-32426#2_0', '-32426#2_0', '-32426#2_0', '-32426#2_0', '-32426#2-AddedOffRampEdge_0', '-32426#2-AddedOffRampEdge_0', '-32426#2-AddedOffRampEdge_0', '-31052_0', '-31052_0', '-31052_0', '-31052_0', '-31052_0', '-31052_0', '-31052_0', '-31052_0', '-31052_0', ':-24374_0_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', '-30692_0', ':-19020_0_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-31156#1_0', '-30668#9-AddedOnRampEdge_0', '-30668#9-AddedOnRampEdge_0', '-30668#9-AddedOnRampEdge_0', '-30668#9-AddedOnRampEdge_0', ':-30668#9-AddedOnRampNode_0_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9_0', '-30668#9-AddedOffRampEdge_0', '-30668#9-AddedOffRampEdge_0', '-30668#9-AddedOffRampEdge_0', '-30668#9-AddedOffRampEdge_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-31432_0', '-32400#5-AddedOnRampEdge_0', '-32400#5-AddedOnRampEdge_0', '-32400#5-AddedOnRampEdge_0', ':-32400#5-AddedOnRampNode_0_0', '-32400#5_0', '-32400#5_0', '-32400#5_0', '-32400#5_0', '-32400#5_0', '-32400#5_0', '-32400#5_0', '-32400#5_0']
pos = [5.1, 20.36, 37.07, 56.34, 77.24, 99.74, 123.57, 149.77, 177.54, 20.57, 51.73, 84.73, 20.79, 58.3, 95.06, 132.07, 168.72, 205.18, 242.02, 279.21, 316.08, 353.54, 390.92, 428.53, 464.92, 501.39, 538.43, 575.74, 613.15, 650.48, 687.86, 725.28, 761.68, 799.03, 836.3, 873.92, 910.95, 948.17, 985.1, 1022.05, 1059.68, 1096.81, 1134.11, 30.89, 68.49, 4.81, 41.71, 78.72, 116.02, 152.48, 190.01, 227.1, 264.29, 300.87, 337.36, 374.41, 411.73, 449.11, 485.54, 522.22, 558.91, 596.47, 634.08, 28.51, 57.12, 81.33, 0.97, 20.55, 39.58, 59.63, 78.67, 97.89, 117.84, 136.88, 156.84, 8.81, 5.32, 25.15, 45.2, 64.4, 84.58, 103.92, 123.83, 144.09, 163.08, 183.31, 202.36, 221.67, 241.93, 7.37, 0.19, 19.41, 39.06, 59.13, 79.09, 98.15, 117.73, 136.71, 156.92, 177.06, 197.23, 0.15, 21.44, 44.41, 69.96, 0.99, 26.56, 57.19, 89.39, 122.95, 158.72, 195.47, 232.92, 270.38, 307.76, 344.81, 381.79, 419.26, 455.91, 493.3, 530.4, 567.5, 605.0, 642.18, 679.45, 716.69, 753.82, 791.12, 827.69, 865.31, 902.08, 939.42, 976.43, 1013.12, 1049.93, 1086.44, 1123.63, 3.93, 37.3, 66.17, 90.65, 10.58, 30.08, 49.87, 69.99, 90.2, 110.14, 130.22, 149.96, 169.78, 189.84, 208.93, 229.1, 248.63, 268.56, 288.18, 307.69, 327.3, 346.82, 367.03, 386.43, 406.46, 426.67, 446.58, 466.41, 485.87, 504.95, 524.84, 544.26, 563.95, 583.68, 603.83, 623.45, 642.93, 662.08, 681.58, 700.97, 720.5, 739.65, 759.16, 778.65, 798.89, 818.17, 838.38, 858.0, 877.21, 896.59, 916.48, 936.5, 956.09, 975.94, 995.43, 1015.1, 1034.89, 1054.99, 1074.91, 1094.4, 1113.69, 1132.72, 1152.69, 1172.07, 1191.72, 1210.93, 1231.04, 1250.83, 1271.01, 1290.26, 1309.68, 1328.88, 1349.06, 1369.08, 1388.33, 1408.21, 1427.99, 1447.15, 1467.22, 1486.57, 1505.68, 1525.67, 1545.83, 1565.62, 1585.17, 1605.16, 1625.0, 1644.22, 1663.45, 1682.92, 1702.09, 1721.89, 1740.91, 1760.86, 1780.38, 1800.58, 1819.95, 1839.14, 11.41, 32.82, 55.66, 5.9, 6.33, 33.91, 63.93, 95.57, 129.65, 166.04, 203.05, 240.46]
speed = [13.89, 15.26, 16.72, 19.26, 20.9, 22.5, 23.84, 26.2, 27.77, 29.48, 31.16, 33.0, 35.11, 37.51, 36.75, 37.02, 36.64, 36.46, 36.84, 37.18, 36.88, 37.45, 37.39, 37.61, 36.39, 36.47, 37.04, 37.3, 37.42, 37.32, 37.38, 37.43, 36.4, 37.35, 37.27, 37.61, 37.04, 37.22, 36.93, 36.96, 37.62, 37.13, 37.3, 37.48, 37.6, 37.0, 36.91, 37.0, 37.3, 36.47, 37.52, 37.09, 37.2, 36.58, 36.48, 37.05, 37.32, 37.38, 36.43, 36.69, 36.68, 37.56, 37.61, 33.11, 28.61, 24.21, 19.71, 19.58, 19.03, 20.05, 19.04, 19.22, 19.95, 19.04, 19.96, 19.37, 19.25, 19.83, 20.05, 19.2, 20.19, 19.34, 19.91, 20.26, 18.99, 20.23, 19.05, 19.3, 20.26, 19.13, 19.44, 19.22, 19.65, 20.07, 19.96, 19.06, 19.58, 18.99, 20.2, 20.14, 20.17, 19.94, 21.29, 22.96, 25.55, 26.86, 29.32, 30.63, 32.21, 33.55, 35.77, 36.75, 37.44, 37.47, 37.38, 37.05, 36.98, 37.47, 36.65, 37.39, 37.1, 37.1, 37.51, 37.18, 37.27, 37.23, 37.14, 37.29, 36.57, 37.62, 36.77, 37.34, 37.01, 36.68, 36.81, 36.51, 37.18, 36.53, 33.37, 28.87, 24.48, 19.98, 19.5, 19.79, 20.12, 20.21, 19.94, 20.08, 19.74, 19.82, 20.06, 19.09, 20.17, 19.52, 19.93, 19.62, 19.51, 19.61, 19.52, 20.21, 19.4, 20.03, 20.21, 19.91, 19.83, 19.46, 19.08, 19.89, 19.42, 19.69, 19.73, 20.15, 19.62, 19.48, 19.15, 19.5, 19.39, 19.54, 19.14, 19.51, 19.49, 20.24, 19.28, 20.2, 19.62, 19.21, 19.38, 19.89, 20.02, 19.59, 19.85, 19.49, 19.67, 19.79, 20.1, 19.92, 19.49, 19.29, 19.03, 19.97, 19.38, 19.65, 19.21, 20.11, 19.79, 20.18, 19.25, 19.42, 19.2, 20.18, 20.02, 19.25, 19.88, 19.78, 19.16, 20.08, 19.35, 19.12, 19.98, 20.16, 19.79, 19.55, 19.99, 19.84, 19.21, 19.23, 19.47, 19.17, 19.8, 19.02, 19.95, 19.53, 20.19, 19.37, 19.19, 19.36, 21.42, 22.83, 24.62, 26.02, 27.57, 30.02, 31.64, 34.08, 36.39, 37.01, 37.41]
# lengths extracted ad-hoc for this route
road_length = {':-24374_0': 22.74, '-32426#1': 1138.61, '-32426#0': 183.08, '-31052': 167.4, '-32400#5': 257.03, ':-30668#9-AddedOnRampNode_0': 3.75, '-32400#5-AddedOnRampEdge': 74.37, '-32426#2-AddedOffRampEdge': 96.92, ':-32400#5-AddedOnRampNode_0': 25.59, '-32426#2': 635.3, '-32426#2-AddedOnRampEdge': 96.93, ':-19020_0': 26.63, '-30668#9-AddedOffRampEdge': 93.56, '-30668#9': 1152.86, '-31156#1': 206.17, '-30668#9-AddedOnRampEdge': 95.83, '-30692': 253.68, '-32426#0-AddedOffRampEdge': 94.05, '-31432': 1843.83}
length = -pos[0]
route = [lane[0][:lane[0].rfind('_')]]
# convert to edge-route (include int. edges) and compute its total length
for to in [to[:to.rfind('_')] for to in lane[1:]]:
if route[-1] != to:
route.append(to)
length += road_length[to]
length -= (road_length[route[-1]] - pos[-1])
print 'trapezoidal-rule based travelled distance:', sum(speed)
print 'travelled distance based on reported road lengths', length
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user