-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into develop
- Loading branch information
Showing
11 changed files
with
345 additions
and
55 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
25 changes: 25 additions & 0 deletions
25
src/main/java/org/matsim/dashboard/MetropoleRuhrDashboardProvider.java
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,25 @@ | ||
package org.matsim.dashboard; | ||
|
||
import org.matsim.core.config.Config; | ||
import org.matsim.simwrapper.Dashboard; | ||
import org.matsim.simwrapper.DashboardProvider; | ||
import org.matsim.simwrapper.SimWrapper; | ||
import org.matsim.simwrapper.dashboard.TripDashboard; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Provider for default dashboards in the scenario. | ||
* Declared in META-INF/services | ||
*/ | ||
public class MetropoleRuhrDashboardProvider implements DashboardProvider { | ||
|
||
@Override | ||
public List<Dashboard> getDashboards(Config config, SimWrapper simWrapper) { | ||
|
||
TripDashboard trips = new TripDashboard("mode_share_ref.csv", "mode_share_per_dist_ref.csv", "mode_users_ref.csv"); | ||
|
||
return List.of(trips); | ||
} | ||
|
||
} |
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,26 +1,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import numpy as np | ||
|
||
from matsim.scenariogen.data import TripMode, run_create_ref_data | ||
|
||
|
||
def person_filter(df): | ||
""" Default person filter for reference data. """ | ||
return df[df.reporting_day <= 5] | ||
# Tuesday to Thursday | ||
return df[(df.reporting_day >= 2) & (df.reporting_day <= 4)] | ||
|
||
|
||
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 | ||
# Long distance mode are ignored as well | ||
return df[(df.main_mode != "other") & (df.gis_length < 100)] | ||
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, trip_filter, | ||
run_create_ref_data.InvalidHandling.REMOVE_PERSONS) | ||
result = run_create_ref_data.create("../../../../shared-svn/projects/rvr-metropole-ruhr/data/MID", | ||
person_filter, trip_filter, | ||
dist_groups=[0, 1000, 2000, 5000, 10000, 20000, 50000, np.inf], | ||
invalid_trip_handling=run_create_ref_data.InvalidHandling.REMOVE_TRIPS) | ||
|
||
print(result.persons) | ||
print(result.trips) | ||
|
||
print(share) | ||
print(result.share) |
1 change: 1 addition & 0 deletions
1
src/main/resources/META-INF/services/org.matsim.simwrapper.DashboardProvider
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 @@ | ||
org.matsim.dashboard.MetropoleRuhrDashboardProvider |
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,36 @@ | ||
dist_group,main_mode,share | ||
0 - 1000,bike,0.08922756652897382 | ||
0 - 1000,car,0.14920930393728898 | ||
0 - 1000,pt,0.01141689518127269 | ||
0 - 1000,ride,0.05266112251043193 | ||
0 - 1000,walk,0.6974851118420325 | ||
1000 - 2000,bike,0.1412980387219933 | ||
1000 - 2000,car,0.2893394369807224 | ||
1000 - 2000,pt,0.07355118760590791 | ||
1000 - 2000,ride,0.14803247616603515 | ||
1000 - 2000,walk,0.3477788605253412 | ||
2000 - 5000,bike,0.17022654579538898 | ||
2000 - 5000,car,0.4199284767872729 | ||
2000 - 5000,pt,0.15407708873488477 | ||
2000 - 5000,ride,0.1477080914190836 | ||
2000 - 5000,walk,0.10805979726336983 | ||
5000 - 10000,bike,0.051336571850878795 | ||
5000 - 10000,car,0.5939631205574252 | ||
5000 - 10000,pt,0.1551416574021224 | ||
5000 - 10000,ride,0.16658004372932197 | ||
5000 - 10000,walk,0.03297860646025174 | ||
10000 - 20000,bike,0.020809262401952737 | ||
10000 - 20000,car,0.6675803912060924 | ||
10000 - 20000,pt,0.1356469565014502 | ||
10000 - 20000,ride,0.159567475292094 | ||
10000 - 20000,walk,0.016395914598410645 | ||
20000 - 50000,bike,0.016706269387170403 | ||
20000 - 50000,car,0.6492250405860016 | ||
20000 - 50000,pt,0.22408126032827708 | ||
20000 - 50000,ride,0.09851721323716982 | ||
20000 - 50000,walk,0.011470216461381298 | ||
50000+,bike,0.04024152153627648 | ||
50000+,car,0.6660439494130431 | ||
50000+,pt,0.16140958352218981 | ||
50000+,ride,0.13230494552849048 | ||
50000+,walk,0.0 |
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,36 @@ | ||
dist_group,main_mode,share | ||
0 - 1000,bike,0.018274383327818906 | ||
0 - 1000,car,0.030559031499997773 | ||
0 - 1000,pt,0.0023382540516596684 | ||
0 - 1000,ride,0.010785338843869218 | ||
0 - 1000,walk,0.14284946676326818 | ||
1000 - 2000,bike,0.02105728428475822 | ||
1000 - 2000,car,0.043119514144725465 | ||
1000 - 2000,pt,0.010961144831928345 | ||
1000 - 2000,ride,0.022060900223378015 | ||
1000 - 2000,walk,0.051828591539901575 | ||
2000 - 5000,bike,0.046015457211230064 | ||
2000 - 5000,car,0.11351461527397798 | ||
2000 - 5000,pt,0.04164995330653673 | ||
2000 - 5000,ride,0.03992829278587998 | ||
2000 - 5000,walk,0.02921060845118482 | ||
5000 - 10000,bike,0.008688445624977822 | ||
5000 - 10000,car,0.10052514396940579 | ||
5000 - 10000,pt,0.026256912098118687 | ||
5000 - 10000,ride,0.028192799011838694 | ||
5000 - 10000,walk,0.0055814562345485996 | ||
10000 - 20000,bike,0.0023225644244755732 | ||
10000 - 20000,car,0.07451001564319057 | ||
10000 - 20000,pt,0.015139834818416709 | ||
10000 - 20000,ride,0.017809652944835996 | ||
10000 - 20000,walk,0.0018299816311333934 | ||
20000 - 50000,bike,0.0011909299394746936 | ||
20000 - 50000,car,0.04628092127404028 | ||
20000 - 50000,pt,0.015973948199656557 | ||
20000 - 50000,ride,0.007022938280156049 | ||
20000 - 50000,walk,0.0008176705331116503 | ||
50000+,bike,0.0009538829674380032 | ||
50000+,car,0.01578787169708562 | ||
50000+,pt,0.0038260445088857597 | ||
50000+,ride,0.00313614965909456 | ||
50000+,walk,0.0 |
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,6 @@ | ||
main_mode,user | ||
pt,0.1630445040891789 | ||
car,0.3870760553176311 | ||
ride,0.16700096730641525 | ||
walk,0.3177808474256387 | ||
bike,0.11064980061817771 |
Oops, something went wrong.