Skip to content

Commit

Permalink
match bike speed to survey data
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Nov 6, 2024
1 parent 60a6f69 commit b60642e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 5 additions & 2 deletions input/v6.4/berlin-v6.4-vehicleTypes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
</attributes>
<length meter="2.0"/>
<width meter="1.0"/>
<!-- 15 kmh -->
<maximumVelocity meterPerSecond="4.16"/>

<!-- The speed was set such that the obtained avg. speed per trip matches the one reported in the SrV survey -->
<!-- Note that this speed includes all the effects of delays that might occur, such as waiting traffic lights -->
<!-- 11.5 kmh -->
<maximumVelocity meterPerSecond="3.28"/>
<passengerCarEquivalents pce="0.2"/>
<networkMode networkMode="bike"/>
</vehicleType>
Expand Down
14 changes: 13 additions & 1 deletion src/main/python/extract_ref_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ def trip_filter(df):

print(result.share)

print(result.groups)
print(result.groups)

t = result.trips

# Weighted mean
wm = lambda x: np.average(x, weights=t.loc[x.index, "t_weight"])

t["speed"] = (t.gis_length * 3600) / (t.duration * 60)

aggr = t.groupby("main_mode").agg(kmh=("speed", wm))

print("Avg speeds. per mode")
print(aggr)

0 comments on commit b60642e

Please sign in to comment.