Tutorial Vehicle-Miles-Traveled (VMT)

Main Page > Tutorials > Vehicle-Miles-Traveled (VMT)

Vehicle-Miles-Traveled (VMT) is verified here. The detailed steps are as follow.

Step 1. Run the Simulation
 * 1) Open Swashsim (version 2019.12.6.1).
 * 2) Open the project file and the network file.
 * 3) Hit the Simulation Button.
 * 4) Set a warm-up time and a simulation Duration.
 * 5) Select Link Performance Measure data, Detector Aggregate Measures Data, Vehicle Time Step Data and Detector Vehicle Actuation Data for output options.
 * 6) Click the Customize to select the links you want to verify.
 * 7) Hit the Run Simulation button.

Step 2. Verify the Link Data Calculationsn 1. Read the TSD file in Rstudio. data = read.csv(file = 'your TSD file path', header = TRUE) 2. Extract the records of vehicles on the subject link. Take Link 46 as example. linkdata=data[data[, 8]==46,]  # Volume 8 is LinkID. 3. For the records of vehicle i, use the LinkPostion (column 25) of the last record minus the LinkPostion of the first record, then we now get the travel distance of vehicle i. 4. Sum the travel distance of all the vehicles, note that the unit of this result is vehicle*feet. allvehid=unique(linkdata[,2]) VMT=0 for(vehid in allvehid) {    veh=linkdata[linkdata[,2]==vehid,] VMT=VMT+veh[dim(veh)[1],25]-veh[1,25] } 5. Divide the result in step 3 by 5280 to transfer the unit into vehicle*mile. print(VMT/5280) 6. The result should match the Veh Hours Traveled (column W) in the LinkResults file.