From c2f7b2fd1ea25a7e79485de5cc3557a75c7fab7d Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 16 Jul 2024 10:31:15 -0500 Subject: [PATCH 1/2] add limit/damage state --- CHANGELOG.md | 1 + pyincore/models/fragilitycurveset.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22bce1e5..614da999 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Remove unused insecure IN-CORE client [#581](https://github.com/IN-CORE/pyincore/issues/581) +- Update port inventory type and corresponding limit state and damage state calculation [#603](https://github.com/IN-CORE/pyincore/issues/603) ### Added - Apply Black formatter [#589](https://github.com/IN-CORE/pyincore/issues/589) diff --git a/pyincore/models/fragilitycurveset.py b/pyincore/models/fragilitycurveset.py index 38726a86..acd45994 100644 --- a/pyincore/models/fragilitycurveset.py +++ b/pyincore/models/fragilitycurveset.py @@ -133,6 +133,11 @@ def calculate_damage_interval( ls_ds_dspatcher = { # 1 LS to 4 DS ("hurricane", "building", 1): FragilityCurveSet._1ls_to_4ds, + ("hurricane", "berth", 1): FragilityCurveSet._1ls_to_4ds, + ("hurricane", "crane", 1): FragilityCurveSet._1ls_to_4ds, + ("hurricane", "equipment", 1): FragilityCurveSet._1ls_to_4ds, + ("hurricane", "tank", 1): FragilityCurveSet._1ls_to_4ds, + ("hurricane", "yard", 1): FragilityCurveSet._1ls_to_4ds, ("hurricane", "electric_facility", 1): FragilityCurveSet._1ls_to_4ds, # 1 LS to 5 DS ("hurricane", "road", 1): FragilityCurveSet._1ls_to_5ds, @@ -142,6 +147,7 @@ def calculate_damage_interval( ("earthquake+tsunami", "building", 3): FragilityCurveSet._3ls_to_4ds, ("tornado", "building", 3): FragilityCurveSet._3ls_to_4ds, ("hurricane", "building", 3): FragilityCurveSet._3ls_to_4ds, + ("hurricane", "warehouse", 3): FragilityCurveSet._3ls_to_4ds, ("flood", "building", 3): FragilityCurveSet._3ls_to_4ds, ("tsunami", "building", 3): FragilityCurveSet._3ls_to_4ds, # 4 LS to 5 DS @@ -405,6 +411,18 @@ def _initialize_limit_states(inventory_type): """ if inventory_type == "building": output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} + elif inventory_type == "berth": + output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} + elif inventory_type == "tank": + output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} + elif inventory_type == "warehouse": + output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} + elif inventory_type == "yard": + output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} + elif inventory_type == "crane": + output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} + elif inventory_type == "equipment": + output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} elif inventory_type == "pipeline": output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0, "LS_3": 0.0} elif inventory_type == "bridge": From 4399482df218371f5b0c14250d202ab1d7de893a Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 16 Jul 2024 15:25:41 -0500 Subject: [PATCH 2/2] yard can be treated as housing --- pyincore/models/fragilitycurveset.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyincore/models/fragilitycurveset.py b/pyincore/models/fragilitycurveset.py index acd45994..862d1aec 100644 --- a/pyincore/models/fragilitycurveset.py +++ b/pyincore/models/fragilitycurveset.py @@ -137,7 +137,6 @@ def calculate_damage_interval( ("hurricane", "crane", 1): FragilityCurveSet._1ls_to_4ds, ("hurricane", "equipment", 1): FragilityCurveSet._1ls_to_4ds, ("hurricane", "tank", 1): FragilityCurveSet._1ls_to_4ds, - ("hurricane", "yard", 1): FragilityCurveSet._1ls_to_4ds, ("hurricane", "electric_facility", 1): FragilityCurveSet._1ls_to_4ds, # 1 LS to 5 DS ("hurricane", "road", 1): FragilityCurveSet._1ls_to_5ds, @@ -417,8 +416,6 @@ def _initialize_limit_states(inventory_type): output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} elif inventory_type == "warehouse": output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} - elif inventory_type == "yard": - output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} elif inventory_type == "crane": output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0} elif inventory_type == "equipment":