SimCenter Forum

Research in Natural Hazards Engineering => Regional Hazard Simulation (R2D, rWhale) => Topic started by: mlochhead on August 31, 2023, 06:44:18 PM

Title: Rerunning DL in Working Directory
Post by: mlochhead on August 31, 2023, 06:44:18 PM
Is there a way to rerun just the Damage and Loss portion of the R2D workflow within the working directory? I set up all my inputs in the GUI, ran once, and want to keep rerunning the DL portion of the analysis for debugging purposes, without going through the entire workflow every time. Let me know!
Title: Re: Rerunning DL in Working Directory
Post by: jyzhao on August 31, 2023, 06:55:06 PM
In the program output panel, after running R2D, there are commands to run the DL calculation, e.g.,
"
11:47:03 Running damage and loss assessment
         Damage and loss assessment command (1):

"/Library/Frameworks/Python.framework/Versions/3.9/bin/python3" "/Applications/R2D.app/Contents/MacOS/applications/performDL/pelicun/DL_calculation.py" "--filenameDL" "/Users/user/Documents/R2D/LocalWorkDir/tmp.SimCenter/Results/Buildings/8001-AIM.json" "--demandFile" "response.csv" "--DL_Method" "HAZUS MH EQ IM" "--Realizations" "100" "--coupled_EDP" "True" "--detailed_results" "False" "--event_time" "off" "--ground_failure" "False" "--log_file" "True" "--resource_dir" "/Users/user/Documents/R2D/LocalWorkDir/tmp.SimCenter/Results" "--dirnameOutput" "/Users/user/Documents/R2D/LocalWorkDir/tmp.SimCenter/Results/Buildings/8001"
"
The command performs DL calculations for one asset, and you may have to create a script to call this command for each asset. Also, you may need to pass the full file path of "response.csv" for the "--demandFile".

For debugging, it may be helpful to set up the above Python command in a python debugger.

Hope this helps.

Jinyan
Title: Re: Rerunning DL in Working Directory
Post by: canceltechnical on September 13, 2023, 07:45:57 AM
Hi jyzhao,
Your sharing is very useful. Nice day!

snake game (https://snake-game.io)
Title: Re: Rerunning DL in Working Directory
Post by: spreadcarved on October 09, 2023, 07:43:15 AM
In the program output panel, after running R2D, there are commands to run the DL calculation, e.g.,
"
11:47:03 Running damage and loss assessment
         Damage and loss assessment command (1): baldi's basics (https://baldisbasics.io/)

"/Library/Frameworks/Python.framework/Versions/3.9/bin/python3" "/Applications/R2D.app/Contents/MacOS/applications/performDL/pelicun/DL_calculation.py" "--filenameDL" "/Users/user/Documents/R2D/LocalWorkDir/tmp.SimCenter/Results/Buildings/8001-AIM.json" "--demandFile" "response.csv" "--DL_Method" "HAZUS MH EQ IM" "--Realizations" "100" "--coupled_EDP" "True" "--detailed_results" "False" "--event_time" "off" "--ground_failure" "False" "--log_file" "True" "--resource_dir" "/Users/user/Documents/R2D/LocalWorkDir/tmp.SimCenter/Results" "--dirnameOutput" "/Users/user/Documents/R2D/LocalWorkDir/tmp.SimCenter/Results/Buildings/8001"
"
The command performs DL calculations for one asset, and you may have to create a script to call this command for each asset. Also, you may need to pass the full file path of "response.csv" for the "--demandFile".

For debugging, it may be helpful to set up the above Python command in a python debugger.

Hope this helps.

Jinyan
it's useful for me. Thank.