VisionEval / VisionEval-Dev

Development version of VisionEval framework
https://visioneval.github.io/
Apache License 2.0
6 stars 32 forks source link

Add code to check for freeway input inconsistencies between marea_dvmt_split_by_road_class.csv and marea_lane_miles.csv input files #154

Open gregorbj opened 3 years ago

gregorbj commented 3 years ago

If an base year marea value for "LdvFwyDvmtProp" in the "marea_dvmt_split_by_road_class.csv" input file is 0 but the corresponding "FwyLaneMi" value in the "marea_lane_miles.csv" file is not zero, the "CalculateRoadPerformance" module will calculate a negative value for freeway light-duty vehicle (LDV) DVMT. This occurs because the module calibrates a value for "lambda" for the base year which is used in the model which splits LDV DVMT between freeways and arterials as a function of the ratio of the "average travel speed" on freeways and arterials. In the calibration of this parameter, the module does an initial calculation as a function of the population of the marea and the ratio of freeway to arterial lane-miles. It then uses a binary search using estimated average speeds to adjust the initial lambda to match the input DVMT targets. Since the inputs says there are freeway lane-miles but no freeway DVMT, the algorithm computes a negative lambda value. This results in negative freeway LDV DVMT for all other model run years.

This is the worst kind of error because the model run does not fail and wrong results are calculated. I had not anticipated this corner case when writing the code. I suggest doing 2 things to catch it in the future: 1) Modify the "Initialize" module in the VETravelPerformance package to check for input file inconsistencies between "marea_dvmt_split_by_road_class.csv" and "marea_lane_miles.csv". This will enable this input error to be caught during model initialization. 2) Modify the "CalculateRoadPerformance" module in the VETravelPerformance package to catch negative lambda errors (or perhaps any value that is outside of a plausible range) and pass appropriate error messages to the framework to write in the log.

jrawbits commented 2 years ago

Consider part 1 of this issue (the initialize function) in relation to a modified architecture for initialize. (see #106 and #20 )