@@ -29,6 +29,8 @@ rem 10/05/2023 Heither: Updated batch_file.yaml parameters, transit assignment
29
29
rem =========================================================================================
30
30
cd %~dp0
31
31
rem -- Read model run settings from batch_file.yaml --
32
+ for /f " eol=# skip=1 tokens=2 delims=:" %%z in (batch_file.yaml) do (set ver=%%z & goto break0)
33
+ :break0
32
34
for /f " eol=# skip=2 tokens=2 delims=:" %%a in (batch_file.yaml) do (set val=%%a & goto break1)
33
35
:break1
34
36
for /f " eol=# skip=4 tokens=2 delims=:" %%b in (batch_file.yaml) do (set wfhFile=%%b & goto break2)
@@ -39,9 +41,9 @@ for /f "eol=# skip=6 tokens=2 delims=:" %%d in (batch_file.yaml) do (set tc14=%%
39
41
:break4
40
42
for /f " eol=# skip=9 tokens=2 delims=:" %%e in (batch_file.yaml) do (set selLinkFile=%%e & goto break5)
41
43
:break5
42
- for /f " eol=# skip=11 tokens=2 delims=:" %%f in (batch_file.yaml) do (set transitAsmt =%%f & goto break6)
44
+ for /f " eol=# skip=12 tokens=2* delims=:" %%g in (batch_file.yaml) do (set transactFilePath1 =%%g & set transactFilePath2 = %%h & goto break6)
43
45
:break6
44
- for /f " eol=# skip=14 tokens=2* delims=:" %%g in (batch_file.yaml) do (set transitFilePath1 =%%g & set transitFilePath2 = %%h & goto break7)
46
+ for /f " eol=# skip=14 tokens=2 delims=:" %%f in (batch_file.yaml) do (set transitAsmt =%%f & goto break7)
45
47
:break7
46
48
for /f " eol=# skip=16 tokens=2 delims=:" %%i in (batch_file.yaml) do (set selLineFile=%%i & goto break8)
47
49
:break8
@@ -51,22 +53,26 @@ for /f "eol=# skip=20 tokens=2 delims=:" %%k in (batch_file.yaml) do (set Urbans
51
53
:break10
52
54
for /f " eol=# skip=22 tokens=2 delims=:" %%l in (batch_file.yaml) do (set RSPrun=%%l & goto break11)
53
55
:break11
56
+ for /f " eol=# skip=25 tokens=2 delims=:" %%m in (batch_file.yaml) do (set srcCode=%%m & goto break12)
57
+ :break12
54
58
59
+ set ver = %ver:~1 ,5 %
55
60
set val = %val:~1 ,3 %
56
61
set wfhFile = %wfhFile:~1 %
57
62
set wfh = %wfh:~1 %
58
63
set tc14 = %tc14:~1 %
59
64
set selLinkFile = %selLinkFile:~1 %
60
65
set transitAsmt = %transitAsmt:~1 ,1 %
61
66
rem Construct complete transit file path
62
- set transitFilePath1 = %transitFilePath1 :~1 ,-1 %
63
- set transitFilePath2 = %transitFilePath2 :~1 ,-1 %
67
+ set transactFilePath1 = %transactFilePath1 :~1 ,-1 %
68
+ set transactFilePath2 = %transactFilePath2 :~1 ,-1 %
64
69
set sep = :\
65
- set transitFilePath = %transitFilePath1 %%sep%%transitFilePath2 %
70
+ set transactFilePath = %transactFilePath1 %%sep%%transactFilePath2 %
66
71
set selLineFile = %selLineFile:~1 %
67
72
set utilFile = %utilFile:~1 ,1 %
68
73
set UrbansimFile = %UrbansimFile:~1 ,1 %
69
74
set RSPrun = %RSPrun:~1 ,1 %
75
+ set srcCode = %srcCode:~1 ,1 %
70
76
REM -- Count number of select link files --
71
77
set tempCnt = 0
72
78
for %%a in (%selLinkFile:None =% ) do set /a tempCnt += 1
@@ -88,25 +94,27 @@ cd Database
88
94
@ echo .
89
95
@ echo ==================================================================================
90
96
@ echo --- Model Run Settings ---
97
+ @ echo Conformity version = %ver%
91
98
@ echo Scenario = %val%
92
99
@ echo Create WFH validation file = %wfhFile%
93
100
@ echo Usual WFH share = %wfh%
94
101
@ echo WFH 1-4 days share = %tc14%
95
102
@ echo Highway assignment select link files = %selLinkFile%
103
+ @ echo Location of network transaction files = %transactFilePath%
96
104
@ echo Run transit assignment = %transitAsmt%
97
- if " %transitAsmt% " EQU " T" (@ echo Location of transit network files = %transitFilePath% )
98
105
if " %transitAsmt% " EQU " T" (@ echo Transit assignment select line file = %selLineFile% )
99
106
@ echo Save utility files = %utilFile%
100
107
@ echo Create UrbanSim travel time file = %UrbansimFile%
101
108
@ echo RSP evaluation run = %RSPrun%
109
+ @ echo Have CMAP-TRIP2 use destination-mode choice code in this model setup = %srcCode%
102
110
@ echo ==================================================================================
103
111
@ echo .
104
112
105
113
set /a trnAsmt = 0
106
114
if " %transitAsmt% " EQU " T" (set /a trnAsmt+=1)
107
115
set check2 = %selLineFile:~0 ,4 %
108
- REM Remove trailing spaces from transitFilePath
109
- set transitFilePath = %transitFilePath :~0 ,-1 %
116
+ REM Remove trailing spaces from transactFilePath
117
+ set transactFilePath = %transactFilePath :~0 ,-1 %
110
118
111
119
if " %check2% " NEQ " None" (
112
120
if not exist Select_Line\%selLineFile% (goto no_select_line_file)
@@ -119,15 +127,6 @@ call %~dp0..\Scripts\manage\env\activate_env.cmd emme
119
127
call python macros\verify_select_link.py %file1% %selLinkFile% %RSPrun% %trnAsmt%
120
128
if %ERRORLEVEL% GTR 0 (goto end)
121
129
122
- SETLOCAL EnableDelayedExpansion
123
- set str1 = %transitFilePath% \transit\tranmodes.txt
124
- REM Following line strips all quotes from str1
125
- set str2 = !str1:^ " =!
126
- if %trnAsmt% EQU 1 (
127
- if not exist " %str2% " (goto transit_files_missing)
128
- )
129
- ENDLOCAL
130
-
131
130
REM Clean up prior to run
132
131
if exist cache\choice_simulator_trips_out (rmdir /S /Q cache\choice_simulator_trips_out)
133
132
if exist cache\choice_simulator_trips_out.001 (rmdir /S /Q cache\choice_simulator_trips_out.001)
@@ -140,6 +139,7 @@ echo.
140
139
echo Select Destination Choice-Mode Choice model run mode:
141
140
echo 1) Minimize run time (default) - resources allocated to support a single model run.
142
141
echo 2) Balanced - resources allocated to support two simultaneous model runs.
142
+ echo [If this is the second of two simultaneous runs: only proceed if srcCode is False (currently set to %srcCode% )]
143
143
echo .
144
144
set /a jobs = 38
145
145
set /a zones = 10
@@ -254,9 +254,20 @@ if exist temp\nul (rmdir temp /S /Q)
254
254
if exist report.txt (del report.txt /Q)
255
255
CD ..
256
256
257
+ rem Activate Python env to build it if necessary
258
+ call %~dp0 ..\Scripts\manage\env\activate_env.cmd
259
+ if " %srcCode% " EQU " T" (
260
+ @ ECHO -- Ensure CMAP-TRIP2 uses the destination choice-mode choice source code in this model setup --
261
+ python -m pip install -e %~dp0 ..\src\Mode-Dest-TOD
262
+ python -m pip install -e %~dp0 ..\src\Mode-Dest-TOD\sharrow
263
+ )
264
+
265
+ rem Activate Emme Python env
266
+ call %~dp0 ..\Scripts\manage\env\activate_env.cmd emme
267
+
257
268
@ ECHO *** Cleaning up databank. ***
258
269
if exist cleanup.rpt (del cleanup.rpt)
259
- call python useful_macros\cleanup_for_rerun.py %file1% % val%>> cleanup.rpt
270
+ call python useful_macros\cleanup_for_rerun.py %val% >> cleanup.rpt
260
271
if exist reports (del reports)
261
272
262
273
REM RUN FREESKIM TO CREATE TIME, DISTANCE AND TOLL MATRICES
@@ -280,18 +291,18 @@ if %counter% GTR 2 (goto loopend)
280
291
@ ECHO BEGINNING TRANSIT SKIM - FULL MODEL ITERATION %counter%
281
292
@ ECHO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
282
293
REM AM Peak Skim
283
- call python macros/skim_transit.py %file1% % val% %counter% AM
294
+ call python macros/skim_transit.py %val% %counter% AM
284
295
if %ERRORLEVEL% neq 0 (goto issue)
285
- call python macros/transit_triple_indexing.py %file1% AM
296
+ call python macros/transit_triple_indexing.py AM
286
297
if %ERRORLEVEL% neq 0 (goto issue)
287
298
call python macros/transit_skim_final_matrices1.py
288
299
if %ERRORLEVEL% neq 0 (goto issue)
289
300
call python macros/transit_skim_wrapup.py %file1% AM
290
301
if %ERRORLEVEL% neq 0 (goto issue)
291
302
REM Midday Skim
292
- call python macros/skim_transit.py %file1% % val% %counter% MD
303
+ call python macros/skim_transit.py %val% %counter% MD
293
304
if %ERRORLEVEL% neq 0 (goto issue)
294
- call python macros/transit_triple_indexing.py %file1% MD
305
+ call python macros/transit_triple_indexing.py MD
295
306
if %ERRORLEVEL% neq 0 (goto issue)
296
307
call python macros/transit_skim_final_matrices2.py
297
308
if %ERRORLEVEL% neq 0 (goto issue)
@@ -332,13 +343,13 @@ REM
332
343
@ ECHO --- Begin ttables.mac Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
333
344
call emme -ng 000 -m macros\ttables.mac %val% %tod_cntr% 92 93 >> blog.txt
334
345
@ ECHO --- End ttables.mac Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
335
- @ ECHO --- Begin net5I_7c.mac Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
336
- call emme -ng 000 -m macros\net5I_7c.mac % tod_cntr% >> blog.txt
337
- @ ECHO --- End net5I_7c.mac Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
346
+ @ ECHO --- Begin TOD_network_prep.py Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
347
+ call python macros\TOD_network_prep.py %val% % tod_cntr% %counter % >> blog.txt
348
+ @ ECHO --- End TOD_network_prep.py Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
338
349
@ ECHO --- Begin assignment Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
339
350
@ ECHO --- Begin assignment Period %tod_cntr% : %date% %time% ---
340
351
@ ECHO -- Run TOD assignment --
341
- call python macros/SOLA_assignment.py %file1% % tod_cntr% %sola_threads% %counter% %RSPrun% %tempCnt% %selLinkFile% %trnAsmt%
352
+ call python macros/SOLA_assignment.py %tod_cntr% %sola_threads% %counter% %RSPrun% %tempCnt% %selLinkFile% %trnAsmt%
342
353
if %ERRORLEVEL% NEQ 0 (goto issue)
343
354
@ ECHO --- End assignment Period %tod_cntr% : %date% %time% >> model_run_timestamp.txt
344
355
@ ECHO --- End assignment Period %tod_cntr% : %date% %time% ---
@@ -409,9 +420,6 @@ call python tg\scripts\urbansim_skims.py
409
420
REM The following lines run transit assignment.
410
421
if " %transitAsmt% " EQU " T" (
411
422
@ ECHO Begin Transit Assignment setup: %date% %time% >> model_run_timestamp.txt
412
- REM -- Build TOD transit networks
413
- call emme -ng 000 -m transit_asmt_macros\setup_transit_asmt_1_build_transit_asmt_networks.mac %val% %transitFilePath%
414
- if %ERRORLEVEL% NEQ 0 (goto issue)
415
423
REM -- Create matrices to hold TOD transit demand
416
424
if " %RSPrun% " EQU " T" (@ ECHO -- Creating HBW transit demand matrices >> model_run_timestamp.txt)
417
425
call python transit_asmt_macros/setup_transit_asmt_2_initialize_matrices.py %file1% %RSPrun%
@@ -470,7 +478,7 @@ pause
470
478
goto end
471
479
472
480
:CheckEmpty2
473
- if %~z1 == 0 (goto badsas )
481
+ if %~z1 == 0 (goto badR )
474
482
goto Rpass
475
483
476
484
:badR
@@ -516,14 +524,6 @@ goto filepass
516
524
pause
517
525
goto end
518
526
519
- :transit_files_missing
520
- @ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521
- @ ECHO TRANSIT TRANSACTION FILES ARE MISSING IN %transitFilePath% \transit.
522
- @ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
523
- @ ECHO .
524
- pause
525
- goto end
526
-
527
527
:no_select_line_file
528
528
@ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
529
529
@ ECHO SELECT LINE FILE %selLineFile% IS SPECIFIED BUT DOES NOT EXIST.
0 commit comments