generated from matsim-scenarios/matsim-scenario-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
146 additions
and
26 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
23 changes: 23 additions & 0 deletions
23
src/main/java/org/matsim/dashboards/LausitzDashboardProvider.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,23 @@ | ||
package org.matsim.dashboards; | ||
|
||
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; | ||
|
||
/** | ||
* Dashboards for the Lausitz scenario. | ||
*/ | ||
public class LausitzDashboardProvider implements DashboardProvider { | ||
@Override | ||
public List<Dashboard> getDashboards(Config config, SimWrapper simWrapper) { | ||
return List.of(new TripDashboard( | ||
"lausitz_mode_share.csv", | ||
"lausitz_mode_share_per_dist.csv", | ||
"lausitz_mode_users.csv") | ||
); | ||
} | ||
} |
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 geopandas as gpd | ||
|
||
from matsim.scenariogen.data import run_create_ref_data | ||
|
||
|
||
def person_filter(df): | ||
df = gpd.GeoDataFrame(df, geometry=gpd.GeoSeries.from_wkt(df.geom, crs="EPSG:4326").to_crs("EPSG:25832")) | ||
df = gpd.sjoin(df, region, how="inner", predicate="intersects") | ||
|
||
return df[df.present_on_day & (df.reporting_day <= 5)] | ||
|
||
|
||
def trip_filter(df): | ||
# Other modes are ignored in the total share | ||
return df[df.main_mode != "other"] | ||
|
||
|
||
if __name__ == "__main__": | ||
region = gpd.read_file("../../../../shared-svn/projects/DiTriMo/data/shp/lausitz.shp").to_crs("EPSG:25832") | ||
|
||
persons, trips, share = run_create_ref_data.create("/Volumes/Untitled/B3_Lokal-Datensatzpaket/CSV", | ||
person_filter, trip_filter, | ||
run_create_ref_data.InvalidHandling.REMOVE_TRIPS) | ||
|
||
print("Filtered %s persons" % len(persons)) | ||
print("Filtered %s trips" % len(trips)) | ||
|
||
print(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.dashboards.LausitzDashboardProvider |
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 @@ | ||
dist_group,main_mode,mean_dist,share | ||
0 - 1000,bike,741.7474152768164,0.05431618817899002 | ||
0 - 1000,car,845.2047065363095,0.031216669310203 | ||
0 - 1000,pt,503.9569413263069,0.0012298417638100443 | ||
0 - 1000,ride,798.8045427222489,0.01929390934129713 | ||
0 - 1000,walk,474.8462693693281,0.14568353330391315 | ||
1000 - 2000,bike,1644.2686306579485,0.01912094472020174 | ||
1000 - 2000,car,1664.6974637289466,0.04206126416523887 | ||
1000 - 2000,pt,1769.9848721595795,0.006125610783078046 | ||
1000 - 2000,ride,1695.6202104840554,0.015018450003780185 | ||
1000 - 2000,walk,1781.56327180136,0.028682645671379056 | ||
2000 - 5000,bike,3415.967452046967,0.025207557865234546 | ||
2000 - 5000,car,3821.2329823444597,0.13695546693420932 | ||
2000 - 5000,pt,3715.77927121702,0.011575801348651667 | ||
2000 - 5000,ride,3336.405564477932,0.03633788006858987 | ||
2000 - 5000,walk,3058.339137223546,0.01911150073233698 | ||
5000 - 10000,bike,6635.65436876184,0.011838556537851376 | ||
5000 - 10000,car,7311.064045237122,0.11269186948089517 | ||
5000 - 10000,pt,6979.744659157714,0.013102503056468777 | ||
5000 - 10000,ride,6898.4939502130765,0.027491496179970917 | ||
5000 - 10000,walk,6657.462194056846,0.006142216096671607 | ||
10000 - 20000,bike,14378.984336238063,0.00281739136837012 | ||
10000 - 20000,car,14576.783406018267,0.0755031637087224 | ||
10000 - 20000,pt,13429.023672194808,0.01383155988361684 | ||
10000 - 20000,ride,14240.788705878334,0.020277335207750966 | ||
10000 - 20000,walk,12940.0,0.0001990871342660644 | ||
20000+,bike,37248.118594095315,0.003061190266223855 | ||
20000+,car,47805.15415602558,0.09845227912097768 | ||
20000+,pt,41088.975762937975,0.0036358034320222465 | ||
20000+,ride,68027.0017296671,0.01901828433527827 | ||
20000+,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,31 @@ | ||
dist_group,main_mode,mean_dist,share | ||
0 - 1000,bike,741.7474152768164,0.2157629203250064 | ||
0 - 1000,car,845.2047065363095,0.12400354220355093 | ||
0 - 1000,pt,503.9569413263069,0.004885362161698109 | ||
0 - 1000,ride,798.8045427222489,0.07664216439942374 | ||
0 - 1000,walk,474.8462693693281,0.5787060109103207 | ||
1000 - 2000,bike,1644.2686306579485,0.17224692864536398 | ||
1000 - 2000,car,1664.6974637289466,0.3788998751588497 | ||
1000 - 2000,pt,1769.9848721595795,0.05518125066003455 | ||
1000 - 2000,ride,1695.6202104840554,0.1352904850685536 | ||
1000 - 2000,walk,1781.56327180136,0.2583814604671981 | ||
2000 - 5000,bike,3415.967452046967,0.10998627809345088 | ||
2000 - 5000,car,3821.2329823444597,0.5975676879599303 | ||
2000 - 5000,pt,3715.77927121702,0.05050784027132093 | ||
2000 - 5000,ride,3336.405564477932,0.15855039206564583 | ||
2000 - 5000,walk,3058.339137223546,0.08338780160965216 | ||
5000 - 10000,bike,6635.65436876184,0.06912354002160712 | ||
5000 - 10000,car,7311.064045237122,0.6579907715325366 | ||
5000 - 10000,pt,6979.744659157714,0.07650353246287123 | ||
5000 - 10000,ride,6898.4939502130765,0.16051868573455097 | ||
5000 - 10000,walk,6657.462194056846,0.03586347024843422 | ||
10000 - 20000,bike,14378.984336238063,0.025014897963181838 | ||
10000 - 20000,car,14576.783406018267,0.6703732954089843 | ||
10000 - 20000,pt,13429.023672194808,0.12280688549155136 | ||
10000 - 20000,ride,14240.788705878334,0.1800372773487143 | ||
10000 - 20000,walk,12940.0,0.0017676437875682608 | ||
20000+,bike,37248.118594095315,0.024653704529394964 | ||
20000+,car,47805.15415602558,0.7928985749351034 | ||
20000+,pt,41088.975762937975,0.029281428380669564 | ||
20000+,ride,68027.0017296671,0.15316629215483207 | ||
20000+,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.07115467203031302 | ||
ride,0.213768422141053 | ||
car,0.49898396490379887 | ||
bike,0.159641024221889 | ||
walk,0.2741758378287667 |