Skip to content

Commit

Permalink
pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
ncerutti committed Sep 30, 2024
1 parent 846272a commit 7281180
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions src/sections/vulnerability-adjustments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ On this page
------------

* :ref:`introduction_vulnerability`
* :ref:`vulnerability_replacements`
* :ref:`vulnerability_adjustments`
* :ref:`vulnerability_replacements_file`
* :ref:`vulnerability_adjustments_json`
* :ref:`vulnerability_adjustments_rng`

|
.. _introduction_vulnerability:
Expand All @@ -26,7 +27,7 @@ These methods offer flexibility when customizing the model's vulnerability setti

|
.. _vulnerability_replacements:
.. _vulnerability_replacements_file:

Vulnerability Replacements
************
Expand All @@ -39,42 +40,43 @@ This method allows the user to replace specific vulnerabilities by providing an

Example format in ``analysis_settings``:

|
.. code-block:: JSON
vulnerability_adjustments: { "replace_file": {} }
|
The user can provide the path to a CSV file with the updated vulnerability data:

|
.. code-block:: JSON
"vulnerability_adjustments": {"replace_file" : "vulnerability_adjustments.csv"}
|
The CSV file should contain updated data for specific vulnerabilities. For an example of the expected file contents, refer to the documentation provided in this repository (https://oasislmf.github.io/sections/Oasis-model-data-formats.html).
The CSV file should contain updated data for the specific vulnerabilities to be replaced. For an example of the expected file contents, refer to the documentation provided in this repository (https://oasislmf.github.io/sections/Oasis-model-data-formats.html).

|
.. _vulnerability_adjustments:

Adjusting the vulnerability file
************
.. _vulnerability_replacements_json:

----

### 2. Replacing Specific Vulnerability Data via JSON format in the ``analysis_settings``
### 2. Replacing Specific Vulnerability Data in JSON format in the ``analysis_settings``

This method allows users to replace data for specific vulnerabilities directly within the ``analysis_settings`` file.

Example format:

|
.. code-block:: JSON
vulnerability_adjustments: { "replace_data": {} }
|
The data can be replaced for specific ``vulnerability_id``s:
You can specify the vulnerability data to be replaced for particular ``vulnerability_id``s:
|
.. code-block:: JSON
"vulnerability_adjustments": {
Expand All @@ -83,38 +85,44 @@ You can specify the vulnerability data to be replaced for particular ``vulnerabi
"2": [[1,1,0.4],...]
}
}
|
This replaces the entire dataset for the specified vulnerabilities. The data format is as follows:
This replaces the entire data for the specified vulnerabilities. The format is as follows:
- `vulnerability_id`
- `intensity_bin_id`
- `damage_bin_id`
- `probability`
|
.. _vulnerability_replacements_json:
----
### 3. Applying Adjustments Using Factors
This method allows users to apply a factor adjustment to specific vulnerabilities, altering the random number extraction process used to calculate probabilities.
Example format:
|
.. code-block:: JSON
vulnerability_adjustments: { "adjustments": {} }
|
The user can apply adjustment factors to the ``vulnerability_id`` as shown below:

|
.. code-block:: JSON
"vulnerability_adjustments": {
"adjustments": {
"2": 0.5,
"8": 1.5
}
}
|
In this example, the factor for ``vulnerability_id`` 2 reduces the extracted random numbers (by multiplying by 0.5), thus lowering the probability of falling into higher damage bins. Conversely, for ``vulnerability_id`` 8, multiplying by 1.5 increases the likelihood of it falling into a higher damage bin.

Expand Down

0 comments on commit 7281180

Please sign in to comment.