-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update bike speed and network filter for new bike network
- Loading branch information
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import numpy as np | ||
import os | ||
from matsim.scenariogen.data import EconomicStatus, TripMode, preparation, run_create_ref_data | ||
|
||
|
||
from extract_ref_data import trip_filter | ||
|
||
def person_filter(df): | ||
df = df[df.reporting_day <= 4] | ||
df = df[df.location == "Berlin"] | ||
|
||
return df | ||
|
||
if __name__ == "__main__": | ||
d = os.path.expanduser("~/Development/matsim-scenarios/shared-svn/projects/matsim-berlin/data/SrV/") | ||
|
||
result = run_create_ref_data.create( | ||
d + "Berlin+Umland", | ||
person_filter, trip_filter, | ||
run_create_ref_data.InvalidHandling.REMOVE_TRIPS, | ||
) | ||
|
||
t = result.trips | ||
|
||
t["speed"] = (t.gis_length * 3600) / (t.duration * 60) | ||
t = t[t.main_mode == TripMode.BIKE] | ||
|
||
t.to_csv('bike_speeds.csv', columns=["t_weight", "age", "speed"], index=False) |