Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add traffic flow recovery documentation and notebook #390

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions manual_jb/content/analyses/traffic_flow_recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Traffic flow recovery

**Description**

This analysis computes the damage to bridges, first calling the bridge damage analysis. It then uses nodes and links
in traffic flow path and Average Daily Traffic (ADT) data of bridges to calculate a traffic flow network post-disaster recovery.
Additionally, the analysis can be used in stochastic calculations with an integer value being imported
to seed the random number generator.

The output of this analysis is a CSV file with recovery trajectory timelines and data.

**Input Parameters**

key name | type | name | description
--- | --- | --- | ---
`pm` <sup>*</sup> | `int` | Performance metrics | Name of the result dataset.
`ini_num_population` <sup>*</sup> | `int` | Population number | An initial population number.
`population_size` <sup>*</sup> | `int` | Population size | A population size.
`num_generation` <sup>*</sup> | `int` | Number generation | Number of iterations per scenario.
`mutation_rate` <sup>*</sup> | `float` | Mutation rate | Mutation rate for the NSGA-II algorithm used for recovery rate.
`crossover_rate` <sup>*</sup> | `float` | Crossover rate | Crossover rate for the NSGA-II algorithm used for recovery rate.
`num_cpu` | `int` | Number of CPUs | Number of CPUs used for parallel computations. <br>Default *1*.

**Input Datasets**

key name | type | name | description
--- | --- | --- | ---
`bridges` <sup>*</sup> | [`ergo:bridges`](https://incore.ncsa.illinois.edu/semantics/api/types/ergo:bridges) | Bridge dataset | A bridge dataset.
`nodes` <sup>*</sup> | [`ergo:roadNetwork`](https://incore.ncsa.illinois.edu/semantics/api/types/ergo:roadNetwork) | Rad nodes | A road network dataset.
`links` <sup>*</sup> | [`ergo:roadNetwork`](https://incore.ncsa.illinois.edu/semantics/api/types/ergo:roadNetwork) | Road links | A road network dataset.
`bridge_damage_value` <sup>*</sup> | [`incore:bridgeDamageValue`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:bridgeDamageValue) | Bridge damages | A bridge dataset.
`unrepaired_bridge` <sup>*</sup> | [`incore:unrepairedBridge`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:unrepairedBridge) | Unrepaired bridges | An unrepaired bridge dataset.
`ADT` <sup>*</sup> | [`incore:ADT`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:ADT) | Bridge traffic | A dataset of daily traffic.

**Output Datasets**

key name | type | name | description
--- |-----------------------------------------------------------------------------------------------------------------------------------| --- | ---
`optimal_solution_of_bridge_repair_schedule` <sup>*</sup> | [`incore:transportationRepairSchedule`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:transportationRepairSchedule) | Repair schedule | A dataset containing results (format: CSV).
`overall_traffic_flow_recovery_trajectory` <sup>*</sup> | [`incore:trafficFlowRecovery`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:trafficFlowRecovery) | Recovery trajectory | A dataset containing results (format: CSV).

<small>(* required)</small>

**Execution**

code snippet:

```
# Create traffic flow recovery instance
traffic_flow_recovery = TrafficFlowRecovery(client)

# Load input datasets
traffic_flow_recovery.load_remote_input_dataset("nodes", nodes)
traffic_flow_recovery.load_remote_input_dataset("links", links)
traffic_flow_recovery.load_remote_input_dataset('bridges', bridges)
traffic_flow_recovery.load_remote_input_dataset('bridge_damage_value', bridge_damage)
traffic_flow_recovery.load_remote_input_dataset('unrepaired_bridge', unrepaired)
traffic_flow_recovery.load_remote_input_dataset('ADT', ADT_data)

# Set analysis parameters
traffic_flow_recovery.set_parameter("num_cpu", 4)
traffic_flow_recovery.set_parameter("pm", 1)
traffic_flow_recovery.set_parameter('ini_num_population', 5)
traffic_flow_recovery.set_parameter("population_size", 3)
traffic_flow_recovery.set_parameter("num_generation", 2)
traffic_flow_recovery.set_parameter("mutation_rate", 0.1)
traffic_flow_recovery.set_parameter("crossover_rate", 1.0)

# Run traffic flow recovery analysis
traffic_flow_recovery.run_analysis()
```

full analysis: [traffic_flow_recovery.ipynb](https://github.com/IN-CORE/incore-docs/blob/main/notebooks/traffic_flow_recovery.ipynb)
1,729 changes: 1,729 additions & 0 deletions notebooks/Galveston_testbed/Galveston_testbed.ipynb

Large diffs are not rendered by default.

Binary file added notebooks/Galveston_testbed/images/Galveston.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,712 changes: 3,712 additions & 0 deletions notebooks/Joplin_testbed/Joplin_testbed.ipynb

Large diffs are not rendered by default.

2,996 changes: 2,996 additions & 0 deletions notebooks/Lumberton_testbed/Lumberton_testbed.ipynb

Large diffs are not rendered by default.

Binary file added notebooks/Lumberton_testbed/images/Capture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/Lumberton_testbed/images/dsdfs-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/Lumberton_testbed/images/sadfsa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ISO-8859-1
89 changes: 89 additions & 0 deletions notebooks/Lumberton_testbed/program_name/program_name_geo_name.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
bgid,bgidstr,Survey,pblackbg,phispbg
371559601011,BG371559601011,2010 dec/sf1,25.417322834645667,25.007874015748033
371559601012,BG371559601012,2010 dec/sf1,25.57894736842105,22.526315789473685
371559601021,BG371559601021,2010 dec/sf1,18.52248394004283,9.314775160599572
371559601022,BG371559601022,2010 dec/sf1,48.18181818181818,10.09090909090909
371559601023,BG371559601023,2010 dec/sf1,14.238952536824879,34.20621931260229
371559601024,BG371559601024,2010 dec/sf1,17.313432835820898,11.144278606965175
371559602011,BG371559602011,2010 dec/sf1,26.746806912096165,5.108940646130729
371559602012,BG371559602012,2010 dec/sf1,28.88160589922163,15.239655878738223
371559602013,BG371559602013,2010 dec/sf1,38.06793118659021,5.866784296426996
371559602021,BG371559602021,2010 dec/sf1,10.614525139664805,26.764855256475368
371559602022,BG371559602022,2010 dec/sf1,10.426716141001856,31.762523191094623
371559603001,BG371559603001,2010 dec/sf1,19.812236969893167,28.876659112981546
371559603002,BG371559603002,2010 dec/sf1,37.41231488698363,5.300077942322681
371559603003,BG371559603003,2010 dec/sf1,56.18055555555556,17.430555555555554
371559603004,BG371559603004,2010 dec/sf1,62.74111675126903,4.263959390862944
371559604011,BG371559604011,2010 dec/sf1,9.85494880546075,2.5170648464163823
371559604012,BG371559604012,2010 dec/sf1,3.4686971235194584,1.7766497461928936
371559604013,BG371559604013,2010 dec/sf1,2.2108843537414966,1.1337868480725624
371559604014,BG371559604014,2010 dec/sf1,1.0712372790573113,0.6963042313872523
371559604021,BG371559604021,2010 dec/sf1,1.0395010395010396,1.3167013167013166
371559604022,BG371559604022,2010 dec/sf1,9.364705882352942,16.752941176470586
371559605011,BG371559605011,2010 dec/sf1,1.1793611793611793,1.3267813267813269
371559605012,BG371559605012,2010 dec/sf1,9.57910014513788,2.0319303338171264
371559605021,BG371559605021,2010 dec/sf1,36.131544785807016,4.024231934227608
371559605022,BG371559605022,2010 dec/sf1,15.978886756238003,2.2552783109404992
371559605023,BG371559605023,2010 dec/sf1,9.446450060168472,1.8050541516245486
371559605031,BG371559605031,2010 dec/sf1,3.968253968253968,2.6077097505668934
371559606001,BG371559606001,2010 dec/sf1,6.806690003889537,0.7779074290159471
371559606002,BG371559606002,2010 dec/sf1,8.536585365853659,12.652439024390244
371559606003,BG371559606003,2010 dec/sf1,19.133192389006343,4.492600422832981
371559607011,BG371559607011,2010 dec/sf1,5.565749235474006,33.63914373088685
371559607012,BG371559607012,2010 dec/sf1,3.1995661605206074,22.830802603036876
371559607013,BG371559607013,2010 dec/sf1,10.642570281124499,4.116465863453815
371559607021,BG371559607021,2010 dec/sf1,10.45958795562599,12.044374009508717
371559607022,BG371559607022,2010 dec/sf1,12.454062882809309,10.37158023683136
371559608011,BG371559608011,2010 dec/sf1,60.64410480349345,8.24235807860262
371559608012,BG371559608012,2010 dec/sf1,35.48117154811716,1.9246861924686192
371559608013,BG371559608013,2010 dec/sf1,83.28298086606245,1.1077542799597182
371559608014,BG371559608014,2010 dec/sf1,91.35559921414537,1.37524557956778
371559608021,BG371559608021,2010 dec/sf1,77.67630644342974,2.384576357179097
371559609001,BG371559609001,2010 dec/sf1,7.298136645962733,2.7950310559006213
371559609002,BG371559609002,2010 dec/sf1,16.138540899042003,7.885040530582168
371559610001,BG371559610001,2010 dec/sf1,15.660685154975528,7.177814029363784
371559610002,BG371559610002,2010 dec/sf1,21.72523961661342,9.26517571884984
371559610003,BG371559610003,2010 dec/sf1,47.22689075630252,4.033613445378151
371559611001,BG371559611001,2010 dec/sf1,34.13705583756345,9.137055837563452
371559611002,BG371559611002,2010 dec/sf1,29.318541996830426,12.123613312202853
371559612001,BG371559612001,2010 dec/sf1,32.585596221959854,3.778040141676505
371559612002,BG371559612002,2010 dec/sf1,29.777777777777775,6.37037037037037
371559612003,BG371559612003,2010 dec/sf1,32.90780141843971,2.553191489361702
371559613011,BG371559613011,2010 dec/sf1,9.1324200913242,1.4024787997390735
371559613012,BG371559613012,2010 dec/sf1,32.48045486851457,27.007818052594175
371559613021,BG371559613021,2010 dec/sf1,8.47018150388937,1.4693171996542784
371559613022,BG371559613022,2010 dec/sf1,51.66666666666667,4.6
371559613023,BG371559613023,2010 dec/sf1,30.246020260492042,52.098408104196814
371559613024,BG371559613024,2010 dec/sf1,40.807651434643994,8.501594048884167
371559613025,BG371559613025,2010 dec/sf1,37.39224137931034,9.482758620689655
371559614001,BG371559614001,2010 dec/sf1,14.864242982052462,3.4054302807179013
371559614002,BG371559614002,2010 dec/sf1,27.89156626506024,10.963855421686747
371559615001,BG371559615001,2010 dec/sf1,6.407322654462242,1.9450800915331807
371559615002,BG371559615002,2010 dec/sf1,26.814268142681424,12.546125461254611
371559615003,BG371559615003,2010 dec/sf1,15.49966009517335,3.8749150237933376
371559615004,BG371559615004,2010 dec/sf1,7.530120481927711,3.5140562248995986
371559616011,BG371559616011,2010 dec/sf1,29.10293509714758,2.4803637866887143
371559616012,BG371559616012,2010 dec/sf1,8.072372999304106,2.0180932498260264
371559616021,BG371559616021,2010 dec/sf1,32.43114909781576,1.282051282051282
371559616022,BG371559616022,2010 dec/sf1,14.770642201834864,4.770642201834862
371559616023,BG371559616023,2010 dec/sf1,21.788617886178862,5.040650406504065
371559617001,BG371559617001,2010 dec/sf1,63.0721489526765,0.7757951900698216
371559617002,BG371559617002,2010 dec/sf1,50.735863671572424,2.6336173508907823
371559617003,BG371559617003,2010 dec/sf1,29.132231404958674,2.634297520661157
371559617004,BG371559617004,2010 dec/sf1,41.254752851711025,5.323193916349809
371559618011,BG371559618011,2010 dec/sf1,3.728517331779784,1.8933877075444219
371559618012,BG371559618012,2010 dec/sf1,26.37628554143981,1.4519056261343013
371559618021,BG371559618021,2010 dec/sf1,14.828583230070219,2.14787277984304
371559618022,BG371559618022,2010 dec/sf1,14.801864801864802,4.0792540792540795
371559618023,BG371559618023,2010 dec/sf1,35.00464252553389,0.8356545961002786
371559618024,BG371559618024,2010 dec/sf1,45.843230403800476,1.0688836104513064
371559619001,BG371559619001,2010 dec/sf1,44.21708185053381,4.98220640569395
371559619002,BG371559619002,2010 dec/sf1,28.333333333333332,9.791666666666666
371559619003,BG371559619003,2010 dec/sf1,28.162911611785095,2.166377816291161
371559619004,BG371559619004,2010 dec/sf1,74.81617647058823,1.1029411764705883
371559619005,BG371559619005,2010 dec/sf1,59.07230559345157,1.227830832196453
371559620011,BG371559620011,2010 dec/sf1,61.268090971743625,1.5161957270847692
371559620012,BG371559620012,2010 dec/sf1,60.5225988700565,2.048022598870056
371559620013,BG371559620013,2010 dec/sf1,11.163895486935866,0.5938242280285035
371559620021,BG371559620021,2010 dec/sf1,43.605236656596176,2.416918429003021
371559620022,BG371559620022,2010 dec/sf1,11.001347103726987,1.796138302649304
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Loading
Loading