CS 177 -- Assignment 2
Reducing the Delays to Car Traffic in Riverside caused by Trains Traveling on the Alameda Corridor East

Due: Tuesday, May 25, 2004 at 11:59pm (1 minute grace period).

Summary:

Write a CSIM program to simulate a segment of railway tracks which crosses several roads, in order to study how changing the scheduling of train traffic affects the waiting times for cars wishing to cross the tracks. Your program must read a problem description, in the form of a regional  "transportation map"  in the format described below, from which it establishes the appropriate parameter values for your CSIM model and conducts a pair of experiments: one with "normal" bi-directional train traffic (i.e., single trains traveling independently in each direction) and the other with uni-directional train traffic (i.e., "synchronized pairs" of trains traveling side-by-side in the same direction).

Note that your program does not need to have any kind of a graphical interface, such as a map of the location(s) of the railway crossings, or an animation to show the flow of trains and car traffic through those crossings.

I. Background Information about Southern California Railways:

A glossy brochure which provides an overview of the Alameda Corridor railway project is available here. (Page 10 shows the locations of major railway lines relative to a map of Southern California.) To summarize, the Alameda Corridor runs north-south between downtown Los Angeles and the ocean cargo terminals at the Los Angeles/Long Beach harbor area. Railway traffic reaches the rest of the United States by following the Alameda Corridor - East, which runs east-west between downtown Los Angeles and the Colton switching yard (near the intersection of I-10 and I-215 in San Bernardino) along two existing routes: a "northern branch" which runs parallel to I-10 through San Bernardino, and a "southern branch" which runs parallel to the 91 freeway through Riverside.

A recent report describes the economic significance of railways to the economy and importance of protecting them as part of Homeland Security. One of the conclusions from this economic significance study (on page 5 of the report) is as follows:

"Increasing capacity of rail moves more military goods, faster, but at the same time added capacity increases the wait times for drivers at street level rail crossings. Upgrading strategic rail lines with overpasses and underpasses will allow increases to capacity and keep the community on a thoughtful growth plan of our critical corridors. By 2025 there will be one train every 8 minutes, 24 hours a day, 7 days a week on the Alameda Corridor East if trade flows grow as expected."

Based on this information, we can see that the volume of rail traffic will be traveling through the city of Riverside will continue to increase in the future, and it will be high enough to disrupt ordinary car traffic within the city. A detailed study of railway crossings in Riverside County is available here. More specifically, Fig 1-1A shows a detailed map of all railway lines and the affected street crossings around the cities of Riverside and Corona, while Fig 3-2A shows a small number of high-priority crossings that were found to be the most critically in need of improvement.

Building a bridge to separate train traffic from car traffic  at a street crossing is very expensive, so it will take a long time before this can be done for even the highest-priority crossing points. Thus, in this assignment you will be evaluating an alternative strategy, in which the two "branches" of the Alameda Corridor - East are turned into one-way routes carrying trains in opposite directions between downtown Los Angeles and the Colton  switching yard. Because there are two parallel tracks along each "branch", this means we can schedule the train traffic to travel as pairs running side-by-side in the same direction on both tracks. The advantage of this new strategy is as follows. Each time car traffic on a street is blocked, two trains will pass through this crossing, rather than just one, even though the street is not blocked for any extra time. Thus, since the number of "train pairs" is half as large as the number of "individual trains", each street crossing will be blocked half as often for the same volume of train traffic.

Clearly, this new policy is more difficult for the railways to administer, and it may also delay the departure of some trains as they wait for a "buddy" to become available. Therefore, you have been asked to write a CSIM  simulation model for this problem which can be used to quantify the amount of improvement that would be experienced by cars if this new side-by-side train scheduling policy were used.

II. Format of the "Transportation Map" Configuration File:

Your program must be able to read an abstract graph theoretic description of a regional transportation map from an input file (such as the sample here), which consists of the following:
Notice that we do not include the length of railway track between two consecutive railway crossings. Instead, we will simply assume that the track runs in a straight line between adjacent crossings and hence that the length of the corresponding track segment is just the Euclidean distance between those crossings.

III. Behavior of Cars and Trains at a Railway Crossing

Each car will be represented by a separate CSIM process. When it is created, the car will receive as parameters the following set of attributes:
You may assume that a cars are "born" 1 mile away from the railway crossing, and are travelling towards it at their target speed. If they need to stop because of congestion at the crossing, they can drop their speed to zero when they reach the obstruction. However, they can accelerate at the constant rate of  3 miles per hour, per second. Thus, when a car starts accelerating, it will reach a speed of 30 miles per hour after 10 seconds. so in zero time.

Assume that the length of roadway between the two crossing gates is  105.6 feet, which is exactly 0.02 miles. Thus, if a car is traveling at constant speed S miles per hour as it crosses the tracks, it will occupy its lane of the crossing area for:

                0.02 (miles) / S (miles/hour) * 3600 (seconds/hour) = 72 / S (seconds)

Similarly, assume that each stopped car occupies exactly 21.12 feet of roadway, which is exactly 0.004 miles. Thus, if a car arrives at the crossing to find itself waiting third in line (say) for a train to get out of the way, it will stop a distance 0.008 miles away from the entrance gate to the crossing. When the car in front starts moving, this stopped car will wait 2 seconds and then start accelerating towards the crossing. Since the cars in front had a head start and all of them are accelerating at the same rate, you will never catch them unless the road becomes blocked by another train before you reach the front of the line and enter the crossing. Thus, you can precompute the amount of time it will take a car queued in the first, second, third, etc., position to reach the entrance of the crossing and schedule a status update at that time. If no new train has appeared, the car will attempt to enter the crossing. Otherwise, it will update its position in the queue in preparation for the next time the crossing becomes available.

The trains always travel at a fixed train speed along the track. Assume that trains are "born" one mile away from the first (or last, if it is going in the reverse direction) crossing. Thereafter, when the front of the train is 0.2 miles away from the entrance to the crossing, it triggers a closure of the crossing to car traffic. The train does not release its control of the crossing until the end of the train is 0.1 miles past the exit from the crossing. For completeness, assume that the amount of track within the crossing area is 13.2 feet (or 0.0025 miles) per lane.

IV. Measurements

Design your program to output the mean and 95% confidence intervals for:
  1. the average utilization of each lane at each crossing by both trains and cars
  2. the maximum number of cars waiting at each crossing at any time
  3. the average waiting time for cars at each crossing.
If you have any questions regarding the specifications, please post them to the mailing list cs164@lists.cs.ucr.edu