-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_rdr_full.bat
69 lines (51 loc) · 2.11 KB
/
run_rdr_full.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@ECHO OFF
cls
set PYTHONDONTWRITEBYTECODE=1
REM default is #ECHO OFF, cls (clear screen), and disable .pyc files
REM for debugging REM @ECHO OFF line above to see commands
REM -------------------------------------------------
REM ==============================================
REM ======== ENVIRONMENT VARIABLES ===============
REM ==============================================
set PATH=C:\Users\%USERNAME%\Anaconda3\Scripts;%PATH%
set PYTHON="C:\Users\%USERNAME%\Anaconda3\envs\RDRenv\python.exe"
set RDR="C:\GitHub\RDR\metamodel_py\Run_RDR.py"
set CONFIG="C:\GitHub\RDR\config\sample_RDR.config"
call activate RDRenv
cd C:\GitHub\RDR\metamodel_py
REM ==============================================
REM ======== RUN THE RDR SCRIPT ==================
REM ==============================================
REM lhs: select AequilibraE runs needed to fill in for TDM
%PYTHON% %RDR% %CONFIG% lhs
if %ERRORLEVEL% neq 0 goto ProcessError
REM aeq_run: use AequilibraE to run core model for runs identified by LHS
%PYTHON% %RDR% %CONFIG% aeq_run
if %ERRORLEVEL% neq 0 goto ProcessError
REM aeq_compile: compile all AequilibraE run results
%PYTHON% %RDR% %CONFIG% aeq_compile
if %ERRORLEVEL% neq 0 goto ProcessError
REM rr: run regression module
%PYTHON% %RDR% %CONFIG% rr
if %ERRORLEVEL% neq 0 goto ProcessError
REM recov_init: read in input files and extend scenarios for recovery process
%PYTHON% %RDR% %CONFIG% recov_init
if %ERRORLEVEL% neq 0 goto ProcessError
REM recov_calc: consolidate metamodel and recovery results for economic analysis
%PYTHON% %RDR% %CONFIG% recov_calc
if %ERRORLEVEL% neq 0 goto ProcessError
REM o: summarize and write output
%PYTHON% %RDR% %CONFIG% o
if %ERRORLEVEL% neq 0 goto ProcessError
REM test: use to test methods under development
REM %PYTHON% %RDR% %CONFIG% test
REM if %ERRORLEVEL% neq 0 goto ProcessError
call conda.bat deactivate
pause
exit /b 0
:ProcessError
REM error handling: print message and clean up
echo ERROR: RDR run encountered an error. See above messages (and log files) to diagnose.
call conda.bat deactivate
pause
exit /b 1