From d806643aaf29badae16fc80cf937231b3bb377d7 Mon Sep 17 00:00:00 2001 From: Lisa Zorn Date: Wed, 27 Mar 2019 17:37:17 -0700 Subject: [PATCH] Minor patch required for model run 2050_TM151_PPA_BF_00 had some transit skim paths which were previously not found but are long paths and resulted in div by zero --- .../scripts/nonres/HsrTransitSubmodeChoice.job | 13 ++++++++++--- .../Prepare Observed Transit Summaries.R | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/model-files/scripts/nonres/HsrTransitSubmodeChoice.job b/model-files/scripts/nonres/HsrTransitSubmodeChoice.job index 3e21ad1f6..261f82e92 100644 --- a/model-files/scripts/nonres/HsrTransitSubmodeChoice.job +++ b/model-files/scripts/nonres/HsrTransitSubmodeChoice.job @@ -228,9 +228,16 @@ loop tpnum=1,5 exp_wlk = exp(utility_wlk) exp_drv = exp(utility_drv) - ; compute the probability - prob_wlk = exp_wlk/(exp_wlk + exp_drv) - prob_drv = 1.0 - prob_wlk + ; this can happen if the ivt is too high -- avoid div by zero errors + if ((exp_wlk + exp_drv)==0) + prob_wlk = 1.0 + prob_drv = 0.0 + else + ; compute the probability + prob_wlk = exp_wlk/(exp_wlk + exp_drv) + prob_drv = 1.0 - prob_wlk + endif + else prob_wlk = 0.0 prob_drv = 1.0 diff --git a/utilities/prepare-validation-data/Prepare Observed Transit Summaries.R b/utilities/prepare-validation-data/Prepare Observed Transit Summaries.R index 26c29d122..6c81af6b0 100644 --- a/utilities/prepare-validation-data/Prepare Observed Transit Summaries.R +++ b/utilities/prepare-validation-data/Prepare Observed Transit Summaries.R @@ -21,9 +21,9 @@ F_INPUT_SURVEY_DIR = "M:/Data/OnBoard/Data and Reports/_data Standardized" F_INPUT_LEGACY_RDATA = file.path(F_INPUT_SURVEY_DIR, "survey_legacy.RData") F_INPUT_STANDARD_RDATA = file.path(F_INPUT_SURVEY_DIR, "survey_standard.RData") -F_VALIDATION_DIR = "M:/Development/Travel Model One/Calibration/Version 1.5.0/2015_TM150_calib13/OUTPUT/validation" +F_VALIDATION_DIR = "M:/Development/Travel Model One/Calibration/Version 1.5.0/2015_TM151_PPA_00/OUTPUT/validation" F_INPUT_RIDERSHIP = "M:/Data/Transit/2015 Ridership/transit ridership growth database.xlsx" -F_INPUT_ESTIMATED = "M:/Development/Travel Model One/Calibration/Version 1.5.0/2015_TM150_calib13/OUTPUT/validation/trnline.csv" +F_INPUT_ESTIMATED = "M:/Development/Travel Model One/Calibration/Version 1.5.0/2015_TM151_PPA_00/OUTPUT/validation/trnline.csv" F_INPUT_MUNI_APC = "M:/Data/Transit/Muni APC Through Time/consolidated-database.csv"