-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated mode shares and scripts so that R and python is consistent
- Loading branch information
Showing
4 changed files
with
23 additions
and
14 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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from matsim.scenariogen.data import run_create_ref_data | ||
from matsim.scenariogen.data import TripMode, run_create_ref_data | ||
|
||
|
||
def person_filter(df): | ||
""" Default person filter for reference data. """ | ||
return df[df.present_on_day & (df.reporting_day <= 4)] | ||
return df[df.reporting_day <= 5] | ||
|
||
|
||
def trip_filter(df): | ||
# Motorcycles are counted as cars | ||
df.loc[df.main_mode == TripMode.MOTORCYCLE, "main_mode"] = TripMode.CAR | ||
|
||
# Other modes are ignored in the total share | ||
return df[df.main_mode != "other"] | ||
|
||
|
||
if __name__ == "__main__": | ||
person, trips, share = run_create_ref_data.create("../../../../shared-svn/projects/NaMAV/data/SrV_2018", | ||
person_filter) | ||
person_filter, trip_filter, | ||
run_create_ref_data.InvalidHandling.REMOVE_TRIPS) | ||
|
||
print(share) |