Skip to content

Commit

Permalink
Feat/601 create sandbox example input for adaptation run (#608)
Browse files Browse the repository at this point in the history
* chore: extend config and reader

* chore: add/correct attributes of config data

* chore: extend reader with options

* Folder structure with input files

* Removing adaptation option input and changing the config file

* Changes to input structure

* Putting input data in the correct location and changes to folder names

* chore: add adaptation property and extend test

* chore: first changes

* chore: add adaptation to enum

* chore: extend classes

* chore: put adaptation in separate enum

* chore: add get_analysis

* chore: remove no_intervention from config

* chore: rename no_intervention to no_adaptation

* Delete ra2ce/analysis/adaptation/adaptation_option_collection.py

* chore: restore no_adaptation_option

* chore: expand logic and add tests

* chore: add losses analysis name to config

* chore: take losses_analysis from config

* chore: fix test

* test: add tests

* chore: fix logic for paths

* chore: small changes

* test: add test data

* chore: small change of folders

* chore: small changes to paths

* chore: small ini change

* chore: typo

* chore: create class and extend factory

* test: fix failing tests

* chore: remove VAT

* chore: add cost calculation

* chore: process review comments

* chore: process review comments

* merge master

* chore: fix issues

* chore: fix test

* updated example, output_graph folder updated

* test: add output_graph files

* test: remove test

* Changes to the notebook

* chore: process review comments

* chore: add base_network in the factory

* chore: add cost calculation

* chore: rename collection attribute

* chore: small changes

* chore: add calculate to collectino

* chore: add root_path

* test: extend conftest

* test: move test input

* chore: add path properties to adaptation_option

* chore: first damages setup

* test: fix/extend tests

* chore: add aggregate_wl to config

* chore: add losses (start)

* chore: big overhaul of the creation of adaptation options

* chore: add docstring

* chore: remove unused imports

* test: fix losses input paths

* chore: fix losses run

* chore: small cleanup

* chore: small changes, add docstring

* chore: fix tests

* chore: small changes

* test: adapt losses configs

* chore: restore graph_file_hazard

* chore: copy static folder as well for avg_speed

* chore: add hazard section with wl_aggregate

* Changes to notebook and input folder structure

* test: correct name of resilience_curve csv

* updated network in test data

* change in naming

* added parameters in the lossess section

* Folder structure revised

* chore: calculate benefit for options

* chore: final changes

* chore: add TODOs

* chore: change readers into dataclasses

* chore: add expected total cost (for now based on unit cost only)

* chore: process rework

* chore/add input files for notebook

* chore/git add ini file

* chore/git add ini file

* chore/add all data for example adaptation

* chore/update notebook and data

* chore/update notebook

* chore/apply review suggestions

---------

Co-authored-by: Ardt Klapwijk <[email protected]>
Co-authored-by: Ardt Klapwijk <[email protected]>
Co-authored-by: hauth <[email protected]>
  • Loading branch information
4 people authored Dec 9, 2024
1 parent 83d5967 commit 15a0caa
Show file tree
Hide file tree
Showing 76 changed files with 1,210 additions and 0 deletions.
81 changes: 81 additions & 0 deletions examples/data/adaptation/analyses.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[project]
name = test

[analysis1]
name = single link redundancy test
analysis = single_link_redundancy
weighing = time
save_gpkg = True
save_csv = True

[analysis2]
name = multi link redundancy test
analysis = multi_link_redundancy
threshold = 1
weighing = distance
save_gpkg = True
save_csv = True

[analysis3]
name = optimal origin dest test
analysis = optimal_route_origin_destination
weighing = distance
save_gpkg = True
save_csv = True

[analysis4]
name = multilink origin dest test
analysis = multi_link_origin_destination
threshold = 1
weighing = distance
save_gpkg = True
save_csv = True

[analysis5]
name = multilink origin closest dest test
analysis = multi_link_origin_closest_destination
threshold = 1
weighing = distance
save_gpkg = True
save_csv = True

[analysis6]
name = multilink isolated locations
analysis = multi_link_isolated_locations
threshold = 1
weighing = distance
buffer_meters = 40
category_field_name = category
save_gpkg = True
save_csv = True

[analysis7]
name = adaptation module
analysis = adaptation
losses_analysis = single_link_losses
discount_rate = 0.05
time_horizon = 10
climate_factor = 0.2
initial_frequency = 0.2
save_gpkg = True
save_csv = True

[adaptation_option0]
id = AO0
name = no adaptation

[adaptation_option1]
id = AO1
name = first adaptation option
construction_cost = 1000
construction_interval = 50
maintenance_cost = 100
maintenance_interval = 5

[adaptation_option2]
id = AO2
name = second adaptation option
construction_cost = 2000
construction_interval = 10
maintenance_cost = 400
maintenance_interval = 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
depth;damage
cm;% of total construction costs
0;0
100;0.1
200;0.2
400;0.4
800;0.8
12000;1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Road_type \ lanes;1;2;3;4;5
unit;euro/m;euro/m;euro/m;euro/m;euro/m
tertiary_link;110;120;130;140;150
tertiary;110;120;130;140;150
secondary_link;11;12;13;14;15
secondary;11;12;13;14;15
residential;1100;1200;1300;1400;1500
['tertiary', 'residential'];510;520;530;540;550
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
link_type_hazard_intensity;duration_steps;functionality_loss_ratio
secondary_0.0-0.2;[1.0];[0.05]
secondary_0.2-0.5;[1, 2.5];[0.125, 0.05]
secondary_0.5-1.5;[2.5, 5, 7.5];[0.375, 0.25, 0.125]
secondary_1.5-9999.0;[7.5, 9, 10];[0.5, 0.45, 0.375]
secondary_link_0.0-0.2;[1.0];[0.05]
secondary_link_0.2-0.5;[1, 2.5];[0.125, 0.05]
secondary_link_0.5-1.5;[2.5, 5, 7.5];[0.375, 0.25, 0.125]
secondary_link_1.5-9999.0;[7.5, 9, 10];[0.5, 0.45, 0.375]
tertiary_0.0-0.2;[2.0];[0.1]
tertiary_0.2-0.5;[2, 5];[0.25, 0.1]
tertiary_0.5-1.5;[5, 10, 15];[0.75, 0.5, 0.25]
tertiary_1.5-9999.0;[15, 18, 20];[1, 0.9, 0.75]
tertiary_link_0.0-0.2;[2.0];[0.1]
tertiary_link_0.2-0.5;[2, 5];[0.25, 0.1]
tertiary_link_0.5-1.5;[5, 10, 15];[0.75, 0.5, 0.25]
tertiary_link_1.5-9999.0;[15, 18, 20];[1, 0.9, 0.75]
trunk_0.0-0.2;[3.0];[0.2]
trunk_0.2-0.5;[3, 7.5];[0.5, 0.2]
trunk_0.5-1.5;[7.5, 15, 22.5];[0.7, 0.6, 0.5]
trunk_1.5-9999.0;[22.5, 27, 30];[1, 0.95, 0.7]
trunk_link_0.0-0.2;[3.0];[0.2]
trunk_link_0.2-0.5;[3, 7.5];[0.5, 0.2]
trunk_link_0.5-1.5;[7.5, 15, 22.5];[0.7, 0.6, 0.5]
trunk_link_1.5-9999.0;[22.5, 27, 30];[1, 0.95, 0.7]
Loading

0 comments on commit 15a0caa

Please sign in to comment.