Skip to content

Commit 1f3c8b7

Browse files
authored
Merge pull request #10 from CMAP-REPOS/develop
c24q4 changes
2 parents 674a353 + b09b47f commit 1f3c8b7

File tree

120 files changed

+24357
-7132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+24357
-7132
lines changed

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Database/cache/*
7373
!Database/cache/*.pkl
7474
Database/computed_auto_propensity.csv
7575
Database/defaults_base_year/*_OUT.TXT
76-
76+
Database/STRAT_s*
7777

7878
# Ignore files generated by post macros.
7979
Database/data/moves*.data
@@ -89,5 +89,4 @@ Database/transit_asmt_macros/report
8989
Database/transit_report_*.txt
9090

9191
# Ignore files generated by results macros.
92-
results/output
93-
results/export_model_data.log
92+
Scripts/share/standard_data/output

Database/Precompile_Model.bat

Lines changed: 0 additions & 87 deletions
This file was deleted.

Database/Submit_Full_Regional_Model_SOLA.bat

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ rem 10/05/2023 Heither: Updated batch_file.yaml parameters, transit assignment
2929
rem =========================================================================================
3030
cd %~dp0
3131
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
3234
for /f "eol=# skip=2 tokens=2 delims=:" %%a in (batch_file.yaml) do (set val=%%a & goto break1)
3335
:break1
3436
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=%%
3941
:break4
4042
for /f "eol=# skip=9 tokens=2 delims=:" %%e in (batch_file.yaml) do (set selLinkFile=%%e & goto break5)
4143
: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)
4345
: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)
4547
:break7
4648
for /f "eol=# skip=16 tokens=2 delims=:" %%i in (batch_file.yaml) do (set selLineFile=%%i & goto break8)
4749
:break8
@@ -51,22 +53,26 @@ for /f "eol=# skip=20 tokens=2 delims=:" %%k in (batch_file.yaml) do (set Urbans
5153
:break10
5254
for /f "eol=# skip=22 tokens=2 delims=:" %%l in (batch_file.yaml) do (set RSPrun=%%l & goto break11)
5355
:break11
56+
for /f "eol=# skip=25 tokens=2 delims=:" %%m in (batch_file.yaml) do (set srcCode=%%m & goto break12)
57+
:break12
5458

59+
set ver=%ver:~1,5%
5560
set val=%val:~1,3%
5661
set wfhFile=%wfhFile:~1%
5762
set wfh=%wfh:~1%
5863
set tc14=%tc14:~1%
5964
set selLinkFile=%selLinkFile:~1%
6065
set transitAsmt=%transitAsmt:~1,1%
6166
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%
6469
set sep=:\
65-
set transitFilePath=%transitFilePath1%%sep%%transitFilePath2%
70+
set transactFilePath=%transactFilePath1%%sep%%transactFilePath2%
6671
set selLineFile=%selLineFile:~1%
6772
set utilFile=%utilFile:~1,1%
6873
set UrbansimFile=%UrbansimFile:~1,1%
6974
set RSPrun=%RSPrun:~1,1%
75+
set srcCode=%srcCode:~1,1%
7076
REM -- Count number of select link files --
7177
set tempCnt=0
7278
for %%a in (%selLinkFile:None=%) do set /a tempCnt+=1
@@ -88,25 +94,27 @@ cd Database
8894
@echo.
8995
@echo ==================================================================================
9096
@echo --- Model Run Settings ---
97+
@echo Conformity version = %ver%
9198
@echo Scenario = %val%
9299
@echo Create WFH validation file = %wfhFile%
93100
@echo Usual WFH share = %wfh%
94101
@echo WFH 1-4 days share = %tc14%
95102
@echo Highway assignment select link files = %selLinkFile%
103+
@echo Location of network transaction files = %transactFilePath%
96104
@echo Run transit assignment = %transitAsmt%
97-
if "%transitAsmt%" EQU "T" (@echo Location of transit network files = %transitFilePath%)
98105
if "%transitAsmt%" EQU "T" (@echo Transit assignment select line file = %selLineFile%)
99106
@echo Save utility files = %utilFile%
100107
@echo Create UrbanSim travel time file = %UrbansimFile%
101108
@echo RSP evaluation run = %RSPrun%
109+
@echo Have CMAP-TRIP2 use destination-mode choice code in this model setup = %srcCode%
102110
@echo ==================================================================================
103111
@echo.
104112

105113
set /a trnAsmt=0
106114
if "%transitAsmt%" EQU "T" (set /a trnAsmt+=1)
107115
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%
110118

111119
if "%check2%" NEQ "None" (
112120
if not exist Select_Line\%selLineFile% (goto no_select_line_file)
@@ -119,15 +127,6 @@ call %~dp0..\Scripts\manage\env\activate_env.cmd emme
119127
call python macros\verify_select_link.py %file1% %selLinkFile% %RSPrun% %trnAsmt%
120128
if %ERRORLEVEL% GTR 0 (goto end)
121129

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-
131130
REM Clean up prior to run
132131
if exist cache\choice_simulator_trips_out (rmdir /S /Q cache\choice_simulator_trips_out)
133132
if exist cache\choice_simulator_trips_out.001 (rmdir /S /Q cache\choice_simulator_trips_out.001)
@@ -140,6 +139,7 @@ echo.
140139
echo Select Destination Choice-Mode Choice model run mode:
141140
echo 1) Minimize run time (default) - resources allocated to support a single model run.
142141
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%)]
143143
echo.
144144
set /a jobs=38
145145
set /a zones=10
@@ -254,9 +254,20 @@ if exist temp\nul (rmdir temp /S /Q)
254254
if exist report.txt (del report.txt /Q)
255255
CD ..
256256

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+
257268
@ECHO *** Cleaning up databank. ***
258269
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
260271
if exist reports (del reports)
261272

262273
REM RUN FREESKIM TO CREATE TIME, DISTANCE AND TOLL MATRICES
@@ -280,18 +291,18 @@ if %counter% GTR 2 (goto loopend)
280291
@ECHO BEGINNING TRANSIT SKIM - FULL MODEL ITERATION %counter%
281292
@ECHO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
282293
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
284295
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
286297
if %ERRORLEVEL% neq 0 (goto issue)
287298
call python macros/transit_skim_final_matrices1.py
288299
if %ERRORLEVEL% neq 0 (goto issue)
289300
call python macros/transit_skim_wrapup.py %file1% AM
290301
if %ERRORLEVEL% neq 0 (goto issue)
291302
REM Midday Skim
292-
call python macros/skim_transit.py %file1% %val% %counter% MD
303+
call python macros/skim_transit.py %val% %counter% MD
293304
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
295306
if %ERRORLEVEL% neq 0 (goto issue)
296307
call python macros/transit_skim_final_matrices2.py
297308
if %ERRORLEVEL% neq 0 (goto issue)
@@ -332,13 +343,13 @@ REM
332343
@ECHO --- Begin ttables.mac Period %tod_cntr%: %date% %time% >> model_run_timestamp.txt
333344
call emme -ng 000 -m macros\ttables.mac %val% %tod_cntr% 92 93 >> blog.txt
334345
@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
338349
@ECHO --- Begin assignment Period %tod_cntr%: %date% %time% >> model_run_timestamp.txt
339350
@ECHO --- Begin assignment Period %tod_cntr%: %date% %time% ---
340351
@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%
342353
if %ERRORLEVEL% NEQ 0 (goto issue)
343354
@ECHO --- End assignment Period %tod_cntr%: %date% %time% >> model_run_timestamp.txt
344355
@ECHO --- End assignment Period %tod_cntr%: %date% %time% ---
@@ -409,9 +420,6 @@ call python tg\scripts\urbansim_skims.py
409420
REM The following lines run transit assignment.
410421
if "%transitAsmt%" EQU "T" (
411422
@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)
415423
REM -- Create matrices to hold TOD transit demand
416424
if "%RSPrun%" EQU "T" (@ECHO -- Creating HBW transit demand matrices >> model_run_timestamp.txt)
417425
call python transit_asmt_macros/setup_transit_asmt_2_initialize_matrices.py %file1% %RSPrun%
@@ -470,7 +478,7 @@ pause
470478
goto end
471479

472480
:CheckEmpty2
473-
if %~z1 == 0 (goto badsas)
481+
if %~z1 == 0 (goto badR)
474482
goto Rpass
475483

476484
:badR
@@ -516,14 +524,6 @@ goto filepass
516524
pause
517525
goto end
518526

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-
527527
:no_select_line_file
528528
@ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
529529
@ECHO SELECT LINE FILE %selLineFile% IS SPECIFIED BUT DOES NOT EXIST.

Database/batch_file.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project details
2-
model_version: c24q2
2+
model_version: c24q4
33
scenario_code: 100
44
# ---------------- Work from home module inputs (trip generation)
55
validationfiles: N
@@ -8,16 +8,19 @@ tc14pct: 0.1031
88
# ---------------- Select link analysis files: provide file name (ex: RSP32_links.txt [stored in Database\Select_Link\]) or use None
99
# ---------------- Can submit up to 5, comma-separated, any order, no spaces, (ex: None,test4.txt,test1.txt,None,None)
1010
selectLinkFile: None,None,None,None,None
11+
# ---------------- Transaction file path: include the path to the transaction files that will build the scenario networks in double quotes (spaces OK),
12+
# ---------------- point to directory above highway\ and transit\, no ending backslash (ex: "M:\catslib\modelprod\c24q2" or "M:/catslib/modelprod/24q2")
13+
transactionFilePath: "M:/proj1/nrf/Conformity/c24q4"
1114
# ---------------- Run Transit Assignment at the end of the model run? Default is False.
1215
runTransitAsmt: False
13-
# ---------------- Transit Assignment input: include the file path to transit transaction files in double quotes (spaces are OK), stop at the
14-
# ---------------- directory above transit\, no backslash at end (ex: "M:\catslib\modelprod\c23q2"), --> Cannot be blank if runTransitAsmt=True <--
15-
transit_file_path: None
1616
# ---------------- Transit select line analysis file: provide file name (ex: rsp57_line.txt [stored in Database\Select_Line\]) or use None
1717
transitSelectFile: None
1818
# ---------------- Save Destination-Mode Choice model utility files in cache folder? Default is False.
1919
util_files: False
2020
# ---------------- Create travel time file for UrbanSim? Default is False.
2121
UrbanSim_file: False
2222
# ---------------- Is this an RSP evaluation run? Default is False.
23-
RSP: False
23+
RSP: False
24+
# ---------------- sourceCode will force CMAP-TRIP2 to use the source code in this model setup if set to True. Default is True.
25+
# ---------------- Set to False if this is the second of two simultaneous runs being submitted.
26+
sourceCode: True

0 commit comments

Comments
 (0)