-
Notifications
You must be signed in to change notification settings - Fork 5
SetupConfiguration
Home > TravelModel > UsersGuide > SetupConfiguration
This page provides details on setting up the travel model to run on a cluster of computers, including descriptions of the necessary configuration files.
On the modeling machine, create a model run folder on the local drive with the following naming convention: {Year}_{Model Version}_{Type of Run (i.e., IPA, [DBP,FBP]_NoProject, [DBP,FBP]_Plan, TIP/STIP}_{Iteration}
For example, the model run, 2035_TM161_FBP_Plan_16, indicates this is a 2035 Model Run using TM 1.6.1 for the FBP Plan.
NOTE: Make sure there is enough space on the modeling machine prior to running! Each model run take about ~40 GB
The MTC travel model requires the model run folder to include two directories, CTRAMP and INPUT and one MS DOS batch file, RunModel.bat.
Currently, MTC staff have been using SetUpModel.bat and SETUPnRUN.bat to perform this step, as it creates transparency regarding the source of these files. These .bat files can be copied from GitHub or from a previous model run, ideally one for the same year as current model run.
SetUpModel.bat will copy over the required model run directories, CTRAMP and INPUT. The .bat script will need to be configured so the correct inputs and CTRAMP files are copied over into the model run. The script will also create a model run folder on the M: drive where inputs and selected outputs will be copied to.
For example, for model run, 2035_TM161_FBP_Plan_16, the following setting should be applied:
:: set the location of the model run folder on M; this is where the input and output directories will be copied to
set M_DIR=M:\Application\Model One\RTP2025\Blueprint\2035_TM161_FBP_Plan_16
:: Should strategies be included? AddStrategies=Yes for Project runs; AddStrategies=No for NoProject runs.
set AddStrategies=Yes
set EN7=ENABLED
:: set the location of the Travel Model Release
set GITHUB_DIR=X:\travel-model-one-v1.6.1_develop
:: set the location of the networks (make sure the network version, year and variant are correct)
set INPUT_NETWORK=M:\Application\Model One\RTP2025\INPUT_DEVELOPMENT\Networks\BlueprintNetworks_v35\net_2035_Blueprint
:: set the location of the populationsim and land use inputs (make sure the land use version and year are correct)
set INPUT_POPLU=M:\Application\Model One\RTP2025\INPUT_DEVELOPMENT\LandUse_n_Popsyn\BAUS_FBP_v08\2035
:: draft blueprint was s23; final blueprint is s24; final blueprint no project is s25.
:: note that UrbanSimScenario relates to the land use scenario to which the TM output will be applied (not the input land use scenario for the TM)
set UrbanSimScenario=s24
:: set the location of the input directories for non resident travel, logsums and metrics
set NONRES_INPUT_DIR=M:\Application\Model One\RTP2025\INPUT_DEVELOPMENT\nonres\nonres_06
set LOGSUMS_INPUT_DIR=M:\Application\Model One\RTP2025\INPUT_DEVELOPMENT\logsums_dummies\logsums_dummies_v01
set METRICS_INPUT_DIR=M:\Application\Model One\RTP2025\INPUT_DEVELOPMENT\metrics\metrics_02
:: set the location of the previous run (where warmstart inputs will be copied)
:: the INPUT folder of the previous run will also be used as the base for the compareinputs log
set PREV_RUN_DIR=M:\Application\Model One\RTP2025\Blueprint\2035_TM161_FBP_Plan_15
:: set the name and location of the properties file
:: often the properties file is on master during the active application phase
set PARAMS=%GITHUB_DIR%\utilities\RTP\config_RTP2025\params_2035_Blueprint.properties
:: set the location of the overrides directory (for Blueprint strategies)
set BP_OVERRIDE_DIR=%GITHUB_DIR%\utilities\RTP\strategy_overrides
:: set calculators for off-model strategies
set runOffModel=Yes
set offModelCalculator_DIR=M:\Application\Model One\RTP2025\INPUT_DEVELOPMENT\offmodel_calculators
set offModelCalculatorVersion=FBP_v3_update2005
::set offModelCalculator_masterLog_DIR=M:\Application\Model One\RTP2025\off_model_master_logFor QAQC purposes and for best practice, compare a diff between the model run SetUpModel.bat and previous model run .bat script to ensure all the necessary changes were made and adopted.
Once SetUpModel.bat has been configured and reviewed, run SETUPnRUN.bat` from the model run folder. This script will:
- Run
SetUpModel.bat - Check the setup log for any noticeable error like 'The system cannot find the file specified' and 'not recognized as internal or external command'
Once this script finishes running, the CTRAMP and INPUT directories as well as RunModel.bat should be copied into the model run folder
The CTRAMP directory contains all of the model configuration files, Java instructions, and Cube scripts required to run the travel model, organized in the following three folders:
- model -- contains all of the UtilityExpressionCalculator files that specify the choice models;
- runtime -- contains all of the Java configuration and JAR (executable) files, as well as the files necessary for Java to communicate with Cube;
- scripts -- contains all of the Cube scripts and associated helper files.
The INPUT directory contains all of the InputFiles required to run a specific scenario. When configuring the model on a new computing system, one should make sure that the results from an established scenario can be recreated before developing and analyzing a new scenario. The INPUT directory contains the following folders:
- hwy -- contains the input free flow highway network, which is named, by convention, freeflow.net (see the HighwayNetworkCoding page for details);
- trn -- contains all of the input transit network files organized across three directories, namely: transit_lines, transt_fares, and transit_support (see the TransitNetworkCoding page for details);
- landuse -- contains the socio-economic input land use file (described on the TazData page) and walk shares file;
- nonres -- contains the fixed, year-specific internal/external trip tables, the fixed, year-specific air passenger trip tables, and files used to support the commercial vehicle model;
- popsyn -- contains the synthetic population files per the formats described on the PopSynHousehold and PopSynPerson pages.
While there is an environment file for reference (tm15-python310.yml), in practice, it doesn't work because python packages for windows don't tend to install well. The following steps work for setting up an environment (as of 2022-11-30 on Windows 10).
conda create --name tm15-python310 python=3.10
conda activate tm15-python310
rem install packages for NetworkWrangler
rem https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-3-install-the-required-python-packages-into-your-conda-environment
pip install M:\Software\Python\SimpleParse-2.2.2-cp310-cp310-win_amd64.whl
pip install M:\Software\Python\pywin32-304.0-cp310-cp310-win_amd64.whl
pip install M:\Software\Python\pandas-1.4.3-cp310-cp310-win_amd64.whl
pip install xlrd
rem install NetworkWrangler (ran `git pull` in here to make sure it's up to date)
cd C:\Users\mtcpb\Documents\GitHub\NetworkWrangler
pip install -e .
rem for notify-slack
pip install requests
rem for RuntimeConfiguration.py
pip install xlwt xlutils
rem for csvToDbf.py
pip install dbfpy3
rem for transitcrowding.py
pip install simpledbf
rem for RunResults.py
pip install xlwings xlsxwriter openpyxl
rem for exporting networks to shapefiles
pip install geopandas
rem for off model calculators
pip install pyreadrConfiguration specific to the locations of libraries and executables have been consolidated in the SetPath.bat file. The version on GitHub is the current version that we use.
Note that the TPP_PATH includes the location that [Cube Voyager] is installed as well as the VoyagerFileAPI, which is a DLL library needed by the CTRAMP core so that its Matrix Manager can read Cube matrix files.
RuntimeConfiguration.py is meant to do the remainder of the runtime-setup automatically, so that all the configuration is in one place and done automatically. This is automatically called in the RunModel.bat. See the script for details.
Now that the model is configured, the user can run the model!
Next Step: Run Model
Previously the MTC/ABAG Analytical Modeling Wiki (http://analytics.mtc.ca.gov/foswiki/Main/WebHome)
Please email lzorn@bayareametro.gov if you find anything missing here.