Ramp Meter Delay

Insert non-formatted text here Main Page > Tutorials > Tutorial: Performance Measures > Tutorial Ramp Metering Measures

Calculating Ramp Meter Delay

The steps to calculate the ramp meter delay are as follows:
 * 1) Open the LinkResultsAllScenarios.csv file.


 * 1) Save the file as a macro-enabled workbook (.xlsm). The following link provides steps on working with .xlsm files: Step-by-Step Macro Guide
 * 2) Copy the Ramp Metering Delay Macro text and paste it into the VBA editor within the LinkResultsAllScenarios.xlsm workbook. The macro text can be found at the bottom of this section.
 * 3) Click the Run button in the VBA editor. The macro will ask for input before calculating the delay.

The macro runtime varies based on the number of replications, the number of ramp meters in the network, and the number of links being considered for each meter. After running, the macro will provide the average ramp meter delay for each ramp and scenario several rows beneath the original data from the .csv file. Each column will provide delay values for one ramp across all the scenarios, in the units of seconds.

The following link leads to a repository containing the appropriate macro: Ramp Meter Delay Macro Macro Process

Use the macro code in ‘Ramp Metering Delay Macro.txt’ with the LinkResults.csv’ SwashSim output file. An example file is in the given folder: ‘LinkResultsAllScenarios_RampMeterDelay.xlsm’

This macro first asks for the interchange type. The input will then set the links of interest to the corresponding Link IDs in the table below.

For each scenario, the macro will then calculate the average delay for "n" replications by dividing the total delay through with the total through volume for each replication and further taking the average across the replications. The macro repeats this calculation for each link of interest. The total average ramp metering delay for an entire ramp is the summation of average delay values of "n" replications for each link along the on-ramp.

$$ Average Delay_{Rep}   =\frac{\sum_{i=1}^{n} \frac{Delay Through_i}{Volume Through_i}}{n} $$

where,

After collecting the average delay across each link for every replication in a scenario, the macro then writes the aggregate average delay for each link and outputs in a table below the original data. This process is shown in the equation below.

$$ Total RM Delay = \sum_{j=1}^{m} {(Average Rep Delay )_j} $$

where,

The macro repeats this process until every scenario is analyzed.

This process is hard-coded to run for 24 scenarios and must be edited within the macro if there are changes to the number of scenarios run. There are slight differences in this process depending on whether or not the interchange has loop ramps, but the overall function is the same regardless of interchange type. The macro is 'split' into two versions of the same process by an if condition. Therefore, if any changes must be made to the calculation process, make sure the changes are made to both blocks within the if condition if the change is necessary for all interchanges, or to the correct block if the change is necessary only for specific interchanges.

Macro Editing

Because there are multiple variables hard-coded in the macro, changes to these variables must be made within the macro itself.

Link IDs

The link IDs for each interchange can be found from lines 29-136. They are sorted by interchange and assigned to arrays either for NB or SB ramps. Links on a SB ramp are assigned to the linkSBRamp array and links on a NB ramp are assigned to the linkNBramp array. The order of the links in the array does not matter (except in cases listed below), but it is important that they are assigned to the correct array.

Link ID Array Structure

Because of the variability in the number of ramp meters, the loops and arrays structured throughout the macro to separate links on direct ramps from loop ramps. Currently, link IDs on loop ramps must be assigned to the 9th array element or above, but this can be changed by altering the loop conditions found on lines 204 (Direct ramp loop) and 240 (Loop ramp loop). Make sure that the loop conditions do not overlap to avoid errors in the calculation (i.e. the first loop runs for array elements 1-8 and the second loop runs for elements 9-14.). The macro only supports up to 14 links in one direction, but this can be changed on lines 11-12. Make sure to also change the array element values in lines 29-136 accordingly (Note: If changes only need to be made for one interchange, identify the interchange in this range and make changes only to those links.). If the total amount of array elements change, edit the loop conditions as well to ensure the loops run for all links (lines 168, 204, 240).

Example: To run a Partial Cloverleaf interchange with 10 links on the direct ramps and 6 links on the loop ramps, do the following:
 * 1) Lines 11-12: Change the number of array elements to 16
 * 2) Lines 74-95: Edit Link IDs and array elements accordingly, so array elements 1-10 contain direct ramp links and elements 11-16 contain loop ramp links (for both arrays)
 * 3) Line 168: Change loop conditions to 'y = 1 to 16' (equal to the max number of links in one direction).
 * 4) Line 204,240: Change loop conditions to 'y = 1 to 10' and 'y = 11 to 16', respectively (corresponding to array elements for direct lamp links and loop ramp links).

If there are more ramp meters, more loops can be created by copying/pasting a 'y loop' (loops starting at lines 204,240) and altering these loop conditions to run for unique array elements.


 * Example: Three y loops with conditions 'y = 1 to 10'; 'y = 11 to 16'; 'y = 17 to 20' for an interchange with three ramp meters in one direction.

If the number of ramp meters change, the if statements writing the output table must be edited as well to provide a column of data for each ramp meter (lines 187-196, 259-268).