Skip to content

Commit

Permalink
final mode share update
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Oct 23, 2023
1 parent 17aa185 commit 66ff934
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 72 deletions.
4 changes: 2 additions & 2 deletions src/main/R/Analysis/srv.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ breaks = c(0, 1, 3, 5, 10, 20, Inf)
relevant <- trips %>%
filter(ST_CODE_NAME=="Leipzig") %>%
filter(E_HVM < 70) %>%
filter(V_VM_LAENG < 70) %>%
filter(GIS_LAENGE >= 0 & E_DAUER > 0) %>%
filter(GIS_LAENGE < 100) %>%
filter(STICHTAG_WTAG <= 5) %>%
mutate(dist_group = cut(GIS_LAENGE, breaks=breaks, labels=levels, right=T))
mutate(dist_group = cut(GIS_LAENGE, breaks=breaks, labels=levels, right=F))

matched <- relevant %>% left_join(lookup, by=c("E_HVM"="category"))

Expand Down
10 changes: 5 additions & 5 deletions src/main/python/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

# Target from SrV
target = {
"walk": 0.272564,
"bike": 0.190819,
"pt": 0.170200,
"car": 0.284754,
"ride": 0.081662
"walk": 0.270794,
"bike": 0.196723,
"pt": 0.166204,
"car": 0.286468,
"ride": 0.079811
}

city = gpd.read_file("../scenarios/input/leipzig-utm32n/leipzig-utm32n.shp")
Expand Down
5 changes: 3 additions & 2 deletions src/main/python/create_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ def trip_filter(df):
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"]
# Long distance mode are ignored as well
return df[(df.main_mode != "other") & (df.gis_length < 100)]


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_TRIPS)
run_create_ref_data.InvalidHandling.REMOVE_PERSONS)

print(share)
58 changes: 29 additions & 29 deletions src/main/resources/mode_share_per_dist_ref.csv
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
dist_group,main_mode,mean_dist,share
0 - 1000,bike,647.1320211664759,0.18648889960816117
0 - 1000,car,715.5733490038705,0.05234787770685268
0 - 1000,pt,802.3537970116731,0.011283809577320864
0 - 1000,ride,729.0617251936227,0.030663712677327124
0 - 1000,walk,499.1497285817478,0.7192157004303381
1000 - 2000,bike,1410.8376133243098,0.32720226728480256
1000 - 2000,car,1500.735907403122,0.16968403169776486
1000 - 2000,pt,1533.2653903592868,0.11751538922105827
1000 - 2000,ride,1487.1708306254736,0.09512585828066737
1000 - 2000,walk,1302.3249718162533,0.2904724535157069
2000 - 5000,bike,3202.914928652807,0.32502884429891704
2000 - 5000,car,3405.7134444946573,0.2673536802459596
2000 - 5000,pt,3498.796011328994,0.25034686219019325
2000 - 5000,ride,3493.776275422576,0.11424498215353364
2000 - 5000,walk,2618.6861353776153,0.043025631111396456
5000 - 10000,bike,6488.004797551106,0.13390529274426183
5000 - 10000,car,7286.224192866411,0.46657794968496363
5000 - 10000,pt,6911.388240153839,0.2673883884644953
5000 - 10000,ride,7091.697700844432,0.12398400299689334
5000 - 10000,walk,8512.500292899185,0.008144366109385872
10000 - 20000,bike,11870.106118880658,0.05597065369100367
10000 - 20000,car,13314.789717119513,0.6443810864079137
10000 - 20000,pt,13268.066606129496,0.21199175918221977
10000 - 20000,ride,12510.881840420803,0.08765650071886284
10000 - 20000,walk,,0.0
20000+,bike,39557.16129260366,0.008270651122581562
20000+,car,45145.502240349495,0.7529385110988895
20000+,pt,39740.679248392946,0.1367767540286853
20000+,ride,38947.640630839625,0.10201408374984364
0 - 1000,bike,625.6709239066038,0.1498342300634102
0 - 1000,car,673.6384671092165,0.07636039086702505
0 - 1000,pt,670.1827034315171,0.014101280024101288
0 - 1000,ride,707.110835224723,0.024163955654332738
0 - 1000,walk,476.61610403606227,0.7355401433911307
1000 - 2000,bike,1413.529565635515,0.2976757821440052
1000 - 2000,car,1516.4289451983675,0.18314890770726613
1000 - 2000,pt,1518.669203788909,0.13345080823082492
1000 - 2000,ride,1521.2388298001295,0.0799250711582756
1000 - 2000,walk,1315.3774223589255,0.30579943075962823
2000 - 5000,bike,3225.5356519111447,0.30772535018665886
2000 - 5000,car,3428.1135956590256,0.2767741787199647
2000 - 5000,pt,3500.8253179738435,0.2595885822887284
2000 - 5000,ride,3486.3862346869414,0.10835558269878572
2000 - 5000,walk,2801.165158479957,0.04755630610586222
5000 - 10000,bike,6456.922399742452,0.115790702653595
5000 - 10000,car,7169.54499240835,0.47486333861330693
5000 - 10000,pt,6940.885272741965,0.2842637177313413
5000 - 10000,ride,7038.083385646529,0.11736304734076954
5000 - 10000,walk,8068.343472517595,0.00771919366098719
10000 - 20000,bike,11501.183789143368,0.05251179348646703
10000 - 20000,car,13226.472750426878,0.6472724582139662
10000 - 20000,pt,12902.874110830719,0.2016743449840846
10000 - 20000,ride,13106.119597514538,0.09771615235870768
10000 - 20000,walk,13810.0,0.0008252509567746149
20000+,bike,26308.486401621365,0.00416730209981478
20000+,car,45398.01656256677,0.7394682209830556
20000+,pt,49455.60522417894,0.1698405150810158
20000+,ride,39425.596734908366,0.08652396183611383
20000+,walk,,0.0
58 changes: 29 additions & 29 deletions src/main/resources/mode_share_ref.csv
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
dist_group,main_mode,mean_dist,share
0 - 1000,bike,647.1320211664759,0.04360576137790145
0 - 1000,car,715.5733490038705,0.012240240940456974
0 - 1000,pt,802.3537970116731,0.002638436437215161
0 - 1000,ride,729.0617251936227,0.00716994170043107
0 - 1000,walk,499.1497285817478,0.16817058966030335
1000 - 2000,bike,1410.8376133243098,0.05161256124243341
1000 - 2000,car,1500.735907403122,0.026765790929684893
1000 - 2000,pt,1533.2653903592868,0.018536760987114285
1000 - 2000,ride,1487.1708306254736,0.015005058574293151
1000 - 2000,walk,1302.3249718162533,0.04581883683363964
2000 - 5000,bike,3202.914928652807,0.09292657641457054
2000 - 5000,car,3405.7134444946573,0.07643709976165831
2000 - 5000,pt,3498.796011328994,0.07157480705949293
2000 - 5000,ride,3493.776275422576,0.032662932075985494
2000 - 5000,walk,2618.6861353776153,0.012301137783270974
5000 - 10000,bike,6488.004797551106,0.025021931407638667
5000 - 10000,car,7286.224192866411,0.08718610903327519
5000 - 10000,pt,6911.388240153839,0.04996496985474348
5000 - 10000,ride,7091.697700844432,0.023168010427770593
5000 - 10000,walk,8512.500292899185,0.0015218798747332046
10000 - 20000,bike,11870.106118880658,0.0042008516746133645
10000 - 20000,car,13314.789717119513,0.04836372612101472
10000 - 20000,pt,13268.066606129496,0.015910944000784487
10000 - 20000,ride,12510.881840420803,0.0065790183525187155
10000 - 20000,walk,,0.0
20000+,bike,39557.16129260366,0.000501334015678044
20000+,car,45145.502240349495,0.04564014147534626
20000+,pt,39740.679248392946,0.008290863480069695
20000+,ride,38947.640630839625,0.006183688503361974
0 - 1000,bike,625.6709239066038,0.042427666982270844
0 - 1000,car,673.6384671092165,0.021622517317779033
0 - 1000,pt,670.1827034315171,0.003992975521235183
0 - 1000,ride,707.110835224723,0.006842363477574613
0 - 1000,walk,476.61610403606227,0.20827852382385292
1000 - 2000,bike,1413.529565635515,0.046904293446247414
1000 - 2000,car,1516.4289451983675,0.028858478340389557
1000 - 2000,pt,1518.669203788909,0.021027628867938655
1000 - 2000,ride,1521.2388298001295,0.012593664705670988
1000 - 2000,walk,1315.3774223589255,0.04818432367167251
2000 - 5000,bike,3225.5356519111447,0.08381183999633887
2000 - 5000,car,3428.1135956590256,0.07538200271094032
2000 - 5000,pt,3500.8253179738435,0.07070134686811573
2000 - 5000,ride,3486.3862346869414,0.02951164327005261
2000 - 5000,walk,2801.165158479957,0.012952399000419555
5000 - 10000,bike,6456.922399742452,0.019847375312634377
5000 - 10000,car,7169.54499240835,0.081395057527758
5000 - 10000,pt,6940.885272741965,0.04872488519615632
5000 - 10000,ride,7038.083385646529,0.020116886719094527
5000 - 10000,walk,8068.343472517595,0.0013231263839797098
10000 - 20000,bike,11501.183789143368,0.003530790840523247
10000 - 20000,car,13226.472750426878,0.0435213409226598
10000 - 20000,pt,12902.874110830719,0.013560190630735951
10000 - 20000,ride,13106.119597514538,0.006570243993060608
10000 - 20000,walk,13810.0,5.548826893645858e-05
20000+,bike,26308.486401621365,0.00020112627705902024
20000+,car,45398.01656256677,0.035688914968844986
20000+,pt,49455.60522417894,0.008197003642608329
20000+,ride,39425.596734908366,0.004175901315450057
20000+,walk,,0.0
10 changes: 5 additions & 5 deletions src/main/resources/mode_users_ref.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main_mode,user
walk,0.34795408095941294
car,0.3507092997070994
ride,0.16356884852805617
bike,0.26412581692795317
pt,0.2773855049775048
car,0.3114662795761375
pt,0.2730115678797592
ride,0.1377769897765719
walk,0.3812113445425378
bike,0.22968769172366532

0 comments on commit 66ff934

Please sign in to comment.