Tutorial Average Speed

Main Page > Tutorials > Tutorial: Performance Measures

Space-Mean Speed Space-Mean Speed is the average speed of all vehicles occupying a given section of roadway over a specified time (essentially, the inverse of travel time for all vehicles over the specified section length).

The steps to verify Space-Mean Speed are as follow: Step 1. Run the Simulation Step 2. Verify the Link Data Calculations ''Note that the average speed may differ by <1% and still be correct. This is due to the truncation of decimals in the excel files.''
 * 1) Open SwashSim.
 * 2) Open the project file and the network file.
 * 3) Open the simulation control panel and set the desired warm-up time, simulation duration, and the number of replications.
 * 4) Ensure that the link performance measure data and vehicle time step data option boxes are checked.
 * 5) Click the Run Simulation button. The CSV output files will be saved in the same folder as the SSIM file you are working in.
 * 1) Open the desired time step data file (ex. TSD_1_0_1.csv).
 * 2) Here you must filter out the vehicles which entered in the link in warm-up time and vehicles which were in the link at the end of the runtime. (For reference please check "Link results (Space Mean Speed) Validation.xlsx" file on this >- link https://github.com/swash17/SwashSim/tree/master/Utilities/PerformanceMeasureCalcs)
 * 3) For filtering, apply a number filter on column A "SimTime" of the TSD file. This filter should be less than "warm-up time" (for the chosen network it was taken as 300 seconds).
 * 4) After applying this filter, go to column B "Vehicle Index" and copy the entire column and paste it in another new sheet (As done in the "Warmup end of runtime filter" sheet in the above mentioned excel file). Use delete duplicate in the data pane to delete the repeated number of vehicle index.
 * 5) Apply another number filter as equal to "simulation end time" (for chosen network it was 1200 seconds).
 * 6) After applying this filter, go to the column B "Vehicle Index" and copy the entire column and paste it "below" the column in the same new sheet that you created in the previous step. Use delete duplicate in the data pane to delete any repeated number of vehicle index.
 * 7) Assign or type a word as "Filter out" just beside the column in the new sheet that you created. Pull the "Filter out" towards the end of the column.
 * 8) Now it's time to clear out all the TSD file. Go back to the TSD file make sure that at this stage it does not have any filters. We will use "Vlookupfunction" in excel to clear out all the unwanted vehicle indices.
 * 9) Insert a new column beside the "Vehicle Index" Column. Name it as "filter". Now use the "Vlookup" function in the first cell of this newly created column. (Please refer to Excel workbook mentioned above)
 * 10) After using Vlookup function as described in the "Link Results (Space Mean Speed) Validation.xlsx" file on https://github.com/swash17/SwashSim/tree/master/Utilities/PerformanceMeasureCalcs now it's time to apply a final link filter.
 * 11) In column "I" (i.e. Link ID column) click the filter arrow, select unwanted links, check the boxes, press okay, and finally delete all the rows to get a clean, filtered file to be used as an Input in the Rscript. (Refer to "Clean data ready to put in Rscrpt" sheet).
 * 12) Now here you can either save your currently open sheet as a .csv file (note that all the other sheets will not be saved) or you can copy all the filtered dataset and paste that into a new workbook and save it as a .csv file.
 * 13) This file is ready to be used as an input. Go to "Time traveled on the link.R" or "Time traveled on the link.txt" file on the GitHub link. Open one of these in Rstudio. Change the Input folder location path mentioned there with local location path of your input file. (Make sure to replace "\" (backslash) with the "/" (forward slash) after pasting the location in read.csv row.)
 * 14) Describe an output folder location and file name on the write.csv part of the code.
 * 15) Select all and run the code. An output file will get generated in the specified folder which will give you the time traveled by all the vehicles on the subject link.
 * 16) Refer "Space Mean Speed Validation" sheet in the excel file mentioned above. (Please pay heed to the comments and text boxes added at appropriate locations in the excel sheet. These will guide you through should you get any difficulties)
 * 17) Open the link results file (ex. LinkResults.csv) and compare your results with the average speed column of the link result file.
 * 18) Ensure that the previously calculated average speed matches the average speed shown in column F of the link results file.

Time-Mean Speed Time-Mean Speed is the average speed of all vehicles passing a point on a roadway over a specified time (instantaneous point speed, as taken by a radar gun or other detector).

The steps to verify Time-Mean Speed are as follow: Step 1. Run the Simulation Step 2. Verify the Detector Data Calculations ''Note that the average speed may differ by <1% and still be correct. This is due to the truncation of decimals in the excel files.''
 * 1) Open SwashSim.
 * 2) Open the project file and the network file.
 * 3) Open the simulation control panel and set the desired warm-up time, simulation duration, and the number of replications.
 * 4) Ensure that the detector aggregate measures data and detector vehicle actuation data output option boxes are checked.
 * 5) Click the Run Simulation button. The CSV output files will be saved in the same folder as the SSIM file you are working in.
 * 1) Open the detector file for the desired link and lane (ex. Link_12_Lane_2_Detector_2_1_1.csv).
 * 2) Calculate an average of all speeds in column J. (For details of calculations refer "TMS Detector Measure.xlsx" file on the GitHub link https://github.com/swash17/SwashSim/tree/master/Utilities/PerformanceMeasureCalcs).
 * 3) Open the detector aggregate measures file (ex. DetectorAggregateMeasures_MediumFreeway.csv).
 * 4) Ensure that the previously calculated average speed matches the average speed shown in column I of the detector aggregate measures file.