27
314 H Probability and Statistics Traffic Modeling Final Report Members: Richa Prasad . Raza Kanjee May 21, 2007

Traffic Modeling Final Report

Embed Size (px)

Citation preview

Page 1: Traffic Modeling Final Report

314 H Probability and Statistics

Traffic Modeling

Final Report

Members: Richa Prasad . Raza Kanjee

May 21, 2007

Page 2: Traffic Modeling Final Report

Contents

1 INTRODUCTION

1.1 What is Traffic Modeling? ........................................................1 1.2 Importance of Traffic Modeling ................................................3

2 PROJECT DESCRIPTION

2.1 Problem Statement ................................................................4 2.2 Purpose of Study ...................................................................4 2.3 Source..................................................................................4 2.4 Software...............................................................................7

3 TECHNOLOGY SURVEY 3.1 Study Area Description ...........................................................8 3.2 Vehicle Detection and Tracking ................................................8 3.3 Accuracy of Source ................................................................9

4 DATA ANALYSIS

4.1 Terminologies......................................................................10 4.2 Analysis by Time Period ........................................................10 4.3 Analysis by Lane..................................................................11 4.4 Lane Change Analysis...........................................................12 4.5 Accepted Lead and Lag Gap Analysis ......................................13 4.6 Input-Output Analysis ..........................................................14 4.7 Spacing Analysis ..................................................................15

5 SUMMARY

6.1 Conclusion ..........................................................................18 6.2 Future Work........................................................................18

7 REFERENCES............................................................................19 8 APPENDIX

8.1 C++ Code...........................................................................20 8.2 Data Tables.........................................................................24

Page 3: Traffic Modeling Final Report

1

1 INTRODUCTION 1.1 What is Traffic Modeling? Traffic Modeling is a tool for analyzing major ways that people travel. The main cause of interest is generally to determine through measurements and modeling of data how efficient current road networks are in terms of time taken and miles traveled to reach a destination, and if the road conditions can be improved. Thus, some of the common measurements take are: Vehicle Based Performance

These include Vehicle Miles Traveled (VMT) and Vehicle Hours of Delay (VHD) among other measurements.

Person Based Performance

These measures provide a mode-neutral way of comparing alternatives Mobility Performance Measures

These are in relation to how long it should ideally take a person to reach a destination.

Efficiency

These measures should be chosen such that improvements in their values can be linked to positive changes in mobility measures,

Reliability Measures

The measurement of reliability is a key aspect of performance measurement and reliability metrics should be developed and applied. Use of continuous data is the best method for developing reliability metrics

However, there are several challenges to collecting data for traffic modeling. Availability

Continuous streams of data are not readily available in many regions. The snapshot nature of data availability makes it difficult to analyze conditions during unique events or over time

Coverage

Data is only available for a portion of the transportation network. This makes it difficult to accurately assess the entire impacts of congestion

Quality

Data sets often contain erroneous data or have gaps in missing data. The data sets need significant cleaning before they can be used and accuracy is compromised

Standards

Data is not consistently collected, analyzed, and stores across different regions, and often times within the same region. Standardization is needed to provide for the meaningful comparison of conditions in different regions

Page 4: Traffic Modeling Final Report

2

Traffic Modeling is based on providing estimates of what would likely happen as a result of a particular change in a system assuming that individuals reacted similarly to past behaviors. Models are thus not a hundred percent accurate since new patterns of behavior may emerge. Thus, transportation engineers also try to measure as often as possible, and if not possible, then model. Table 1 provides the advantages and limitations of using the two approaches.

Advantages Limitations Provides predictive capabilities Only as good as the data used to develop the

model Once developed, can provide rapid analysis Provides only a simulation of what is

happening in the real-world. Results must be validated against observed data

Can be developed to provide micro- and macro- level analysis

Difficult to predict traveler reactions to unique conditions or innovative strategies

Modeling

Technology advances in data management are providing for more advanced and

accurate models

Can be costly to develop initial models

Provides a more accurate assessment of what is happening on the ground

Data availability and quality issues may limit usefulness of the data

Can be used to analyze traveler reactions to specific or unique events

Can be costly to implement extensive data collection programs or systems

Measurement

Technology advances in data collection and better data management are providing

improved measurements

Table 1: Disadvantages and Limitations of Modeling VS Measurement Figure 2 shows the tradeoffs between relative cost of analysis and conditions being analyzed. It provides us a picture of when to use which approach.

Figure 2: Modeling VS Measurement Trade-offs

Page 5: Traffic Modeling Final Report

3

1.2 Importance of Traffic Modeling Traffic Modeling is extremely important for the improvement of the efficiency of road networks, thus reducing time required to reach a destination and allowing for greater and easier mobility of people traveling from far origins. One of the most standard measures used in Traffic Modeling are Vehicle Miles Traveled (VMT) and Vehicle Hours of Delay (VHD). Figure 3 shows a satellite view of the City of Oxford and University area. The yellow circles represent the locations where the traffic flowing through the point was counted.

Figure 3: Satellite Map of City of Oxford and University area

We judge through these counts how congested the downtown area is, how far a traveler comes from, what is the reason for the travel, and the hours of delay suffered by the driver. This provides improvements that can be implemented in future traffic models, as well as provides means of testing on current traffic models to predict the impact of the improvements. Since the downtown area is very congested, the vehicle data can also be used to estimate tailpipe emissions and zones with the worst air pollution. These are some of the ways traffic modeling can help improve future road networks and traffic management. The importance of performing such improvements lies in reducing delays, improving efficiency and productivity per person, allowing more flexibility in relocation to employees and in some cases, even determining how to make the region more environmentally friendly.

Page 6: Traffic Modeling Final Report

4

2 PROJECT DESCRIPTION 2.1 Problem Statement The aim of this project was to understand traffic behavior on an interstate highway and put forth lines of further study. The approach to accomplish this goal was through analyzing:

• Spacing between vehicles in same lane • Lane Change Behavior • Flow and Speed of vehicles through a section

We compared our results to ideal road behavior patterns and tried to suggest reasons for differences in behavior. 2.2 Purpose of Study The purpose of this study is to provide data on current road behavior patterns and to highlight any differences. The importance of this study pertains to all aspects of road planning and traffic management, among which some are:

• Road Capacity If the road being studied is heavily congested, then productivity and efficiency are being compromised. On the other hand, if a road is sparsely used, then perhaps extensions can be built to divert traffic to it from heavily congested roads.

• Mandatory lane change notification distance

If a road is heavily congested, then vision obstruction is risked as well as the necessary distance for warning vehicles of mandatory lane changes increases, as vehicles will be spaced closer together.

• Air Pollution

Heavily congested roads are at great risk of being seriously polluted, which may cause severe health problems to travelers and people living around the area.

• Safety

The Registry of Motor Vehicles’ study book deeply stresses on maintaining a good distance between one’s vehicle and the vehicle in front. Thus, roads suffering from heavy congestion are also at risk of being unsafe – may it be due to close spacing or driver inattention due to frustration with the traffic.

2.3 Source The source of our data is from the Next Generation Simulation (NGSIM) test site on a section of the Interstate-80 highway in California. Figure 4 shows the section of the highway of which vehicle trajectory data was collected. The sections marked 1 to 7 represent the area covered by each of the seven cameras.

Page 7: Traffic Modeling Final Report

5

Figure 4: Study Area Schematic and Camera Coverage

Figure 5 provides a more detailed schematic of the study area.

Page 8: Traffic Modeling Final Report

6

Figure 5: Detailed Schematic of Study Area

The data collected was outputted in a text file. Table 1 shows the columns of data provided.

Table 1: Data Table Columns

1. Vehicle ID – Subject vehicle relative to which all data is presented in the row

2. Frame ID – The data is collected 10 times per second – 10 frames per second

3. Total Frames – Number of frames for which data is available for subject vehicle

4. Time – Global Time elapsed since Jan 1, 1970 (ms)

5. Local X – Lateral coordinate of the front center of the vehicle with respect to the

left-most edge of the section in the direction of travel (feet)

6. Local Y – Longitudinal coordinate of the front center of the vehicle with respect

to the entry edge of the section in the direction of travel (feet)

7. Global X - X Coordinate of the front center of the vehicle based on CA State

Plane III in NAD83 (feet)

8. Global Y - Y Coordinate of the front center of the vehicle based on CA State

Plane III in NAD83 (feet)

9. Vehicle Length (feet)

10. Vehicle Width (feet)

11. Vehicle Class – 1: Motorcycle. 2: Auto. 3: Truck

Veh ID

Total Frames

Frame ID

Local X

Local Y

Global X

Global Y Time

SV W

SV Class v a Lane

ID Lead

V Follow

V

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

SV L

2950 ft

1605 ft

755 ft 590 ft

Local Y (North) Local X (West)

Traffic EB I-

2 1

3 4 5 6

Page 9: Traffic Modeling Final Report

7

12. Vehicle Velocity – Instantaneous velocity of vehicle (feet/second)

13. Vehicle Acceleration – Instantaneous acceleration of vehicle (feet/second2)

14. Lane ID - Current lane position of vehicle. Lane 1 is farthest left lane; lane 6 is

farthest right lane. Lane 7 is the on-ramp at Powell Street, and Lane 9 is the

shoulder on the right-side.

15. Preceding Vehicle - Vehicle ID of the lead vehicle in the same lane. A value of

'0' represents no preceding vehicle - occurs at the end of the study section and

off-ramp due to the fact that only complete trajectories were recorded by this

data collection effort (vehicles already in the section at the start of the study

period were not recorded)

16. Following Vehicle - Vehicle ID of the vehicle following the subject vehicle in the

same lane. A value of '0' represents no following vehicle - occurs at the beginning

of the study section and on-ramp due to the fact that only complete trajectories

were recorded by this data collection effort (vehicle that did not traverse the

downstream boundaries of the section by the end of the study period were not

recorded)

The time period relevant to our study was 4:00-4:15pm on April 13, 2005. The length of the section studied was 2950 ft as seen in Figure 5. 2.4 Software There were three parts to this project: 1. Extraction of relevant data

Problem: The text file containing the data was not formatted properly Solution: C++ program rewrote the data with proper formatting

2. Calculation of relevant data

Problem: The size of the data was about 1 GB, thus rendering C++ inefficient Solution: Imported formatted data into SQL table for faster calculations

3. Graphing calculated data

Matlab: Utilized for graphing of massive data. (Example: spacing analysis) Excel: Utilized for graphing of summarized data. (Example: number of

vehicles entering study section)

Page 10: Traffic Modeling Final Report

8

3 TECHNOLOGY SURVEY 3.1 Study Area Description Trajectory data of vehicles on Interstate-80 in Emeryville, California were collected through the use of video cameras mounted on a 30-story building, Pacific Park Plaza, which is located in 6363 Christie Avenue and is adjacent to interstate freeway I-80. The University of California at Berkeley maintains traffic surveillance capabilities at the building and the segment is known as the Berkeley Highway Laboratory (BHL) site. Lane numbering is incremented from the left-most lane (High Occupancy Vehicle lane). Video data were collected using seven video cameras, with the first camera recording the southernmost, and the seventh camera recording the northernmost section of the study area. Complete vehicle trajectories were transcribed at a resolution of 10 frames per second. 3.2 Vehicle Detection and Tracking Vehicle trajectory data was transcribed by using special software specifically made for NGSIM. The program automatically detects and tracks most vehicles from video images and transcribes the trajectory data to a database. Figure 6 shows the flow process for the vehicle transcription.

Inputs • XML File

o AVI Files Source Video Rectified Video

o Calibration Parameters Camera Matrix (focal length, principal point) Distortion Parameters (lens) Rotation and Translation (world coordinates)

o Shadow Parameters • Database

Automatic Detection & Tracking

Vehicle Trajectory Data

Alerts

Manual Corrections

Accurate No

Yes

Figure 6: Vehicle Transcription Process

Page 11: Traffic Modeling Final Report

9

The software detects vehicles in a user-defined detection zone, which is usually set in the camera that is looking straight down from the building, and then tracks vehicles both upstream and downstream from the point of detection. Hence, vehicle tracking is divided into two parts: a) forward cameras 4, 5, 6, 7, and b) reverse cameras 4, 3, 2, 1. Forward tracking was first performed for the data from 4:00pm to 4:15pm. Immediately after 4:15pm, vehicle detection was stopped. However, to account for full vehicle trajectories, tracking continued to allow the vehicles which were already detected to be tracked completely to the end of the study area. For reverse tracking, vehicle information was retrieved from the database generated by the forward tracking. Thus, reverse tracking started from 4:15pm and tracked back to 4:00pm. In the same way as forward tracking, vehicles enter into the tracking system and are tracked from start to end. Therefore, the actual tracking time is 3:58:55pm to 4:15:37pm. 3.3 Accuracy of Source This is a key issue which unfortunately we cannot address due to a lack of response from Cambridge Measurements Inc – the company which handled all the data collection. The importance of the inaccuracy is in validating this entire report as well as all lines of reasoning and future work we propose. In a broader context, the inaccuracy of the data effects all driving behavior pattern analyses and thus questions the validity of the source.

Page 12: Traffic Modeling Final Report

10

4 DATA ANALYSIS 4.1 Terminologies

TMS(t,s) = Time Mean Speed

v(t,s) = Instantaneous speed of a vehicle i in section s during time period t at

midsection

n(t,s) = Number of vehicles traversing section s during time period t

SMS(t,s) = Space Mean Speed

d(t,s) = Distance traveled by vehicle i in section s during time period t

tt(t,s) = Travel time of vehicle i in section s during time period t

Time Mean Speed (TMS) provides a rough idea of how quickly the traffic is moving at the midpoint of a section. Space Mean Speed (SMS) is a more detailed calculation which provides the average speed of the traffic over the entire section being studied. TMS and SMS are very important in conjunction to each other because they provide the complete picture. For example, if the testing time period is 10 minutes and the traffic stood still for 30 seconds, then we would see a decline in the TMS but this decrease in magnitude would not be severe as the average instantaneous speed is being taken over 10 minutes which is relatively very large when compared to 30 seconds. However, SMS would indicate the stop in traffic for 30 seconds more significantly as tt(t,s) will have increased considerably. 4.2 Analysis by Time Period Figure 7 shows the flow of traffic by time period.

),(

),(),(

stn

stvstTMS i

i∑= ∑

∑=

ii

ii

sttt

stdstSMS

),(

),(),(

5000

5500

6000

6500

7000

7500

8000

8500

9000

4:00-4:05pm 4:05-4:10pm 4:10-4:15pm

Time Period (Minutes)

Flow

(vp

h)

Figure 7: Flow by Time Period

Page 13: Traffic Modeling Final Report

11

The flow of traffic is the vehicles traveling per hour through the section being studied. We see a dip in the flow between 4:05pm-4:10pm and generally the flow is lower than at 4:00-4:05pm. There could be two possible reasons for this:

1. Increasing congestion 2. Fewer vehicles

In order to determine the cause, we graph the TMS and SMS by time period as seen in Figure 8.

Figure 8: TMS and SMS by Time Period We see a decline in the speeds of the vehicles over the 15 minutes time period. Thus, we can rule out possibility 2 as fewer vehicles on the road would result in increasing SMS and TMS. The cause is increasing congestion which has resulted in decreasing flow. 4.3 Analysis by Lane Figure 9 shows the flow of traffic by lane.

0

5

10

15

20

25

4:00-4:05pm 4:05-4:10pm 4:10-4:15pm

Time Period (Minutes)

Speed (

mph)

TMS (mph) SMS (mph)

0200400600800

10001200140016001800

1 2 3 4 5 6

Lane

Flow

(vph)

Figure 9: Flow by Lane

Page 14: Traffic Modeling Final Report

12

The flow of the traffic is V-shaped for the analysis by lane. We see decreasing flow as one approaches Lane 3. Lane 6 has high flow probably due to its connection to outer road systems. Lane 1 is the HOV lane, thus it has fewer vehicles and higher flow. In order to explain the decline in flow towards Lane 3, we plot the TMS and SMS by Lane as seen in Figure 10.

Figure 10: TMS and SMS by Lane We see a fairly consistent TMS and SMS except for Lane 1 which is explained by it being the HOV Lane. The TMS remains almost constant for Lanes 2 to 3 thus telling us that the average instantaneous speeds of the vehicles across the lanes are approximately the same. The SMS however drops in magnitude between Lane 3 and 4, hence informing us that even though the average instantaneous speed at the midsection remains fairly constant, the vehicles are traveling slower in Lanes 4 to 6. This relates to the flow by lane graph which shows a similar dip around Lane 3. 4.4 Lane Change Analysis It is possible that the decrease in SMS and flow in Lane 3 is due to a significant number of vehicles switching to and from Lane 3. When a vehicle makes a lane change, it has to slow down or speed up according to the lane it is changing into. Since the SMS decreases across lanes, we can assume that vehicles have to reduce their speed to switch lanes around Lane 3. Figure 11 shows the percent end lane distribution by starting lane.

05

1015202530354045

1 2 3 4 5 6

Lane

Speed (

mph)

TMS (mph) SMS (mph)

0.00%

20.00%

40.00%

60.00%

80.00%

100.00%

120.00%

1 2 3 4 5 6

Starting Lane

Endi

ng

Lane

1 2 3 4 5 6

Figure 11: Percent end lane distribution by starting lane

Page 15: Traffic Modeling Final Report

13

We see decreasing retention of vehicles from Lanes 1 to 5. The high retention in Lane 1 is explained by it being the HOV Lane while Lane 6 is connected to exit and entrance ramps which would specify that the car needs to travel in Lane 6 for a period of time before switching lanes or exiting the freeway. This is especially true since our study area length is not very long as well as the relatively low SMS in Lanes 3 to 5 would cause vehicles in Lane 6 to take longer in switching to Lane 5. As predicted, we do see a high retention of vehicles in Lane 3 as well as a relatively larger number of vehicles switching to Lane 3. However, Lane 4 shows a similar distribution, thus we cannot conclusively state that the high retention and switching of lanes to Lane 3 is the reason for the low flow and SMS in Lane 3. 4.5 Accepted Lead and Lag Gap Analysis We have determined that the decrease in flow in Lane 3 is due to higher congestion in the lane as seen by the lower SMS. We have also concluded that a relatively higher number of vehicles switch to lane 3 and lane 3 also retains a large percentage of its vehicles. However, lane 4 shows a lower SMS but higher flow as well as almost the same distribution of lane change. In order to address this seeming contradiction, we should analyze the lead and lag gaps between cars when switching lanes. Figure 12 explains what we mean by accepted lead and lag gaps.

Figure 12: Lead and Lag Gap

Lead and Lag Gaps tell us how closely the subject vehicle can be spaced from the leading and following vehicle in the lane the subject vehicle wants to switch to. Thus, it would stand to reason that if the gaps are small, then the subject vehicle needs to more closely follow the speeds of the leading and following vehicle in the next lane in order to make the switch. Figure 13 shows the average accepted lead and lag gaps during lane change.

Total Gap

Lag Gap Lead Gap

Lag Vehicle

Lead Vehicle

Subject Vehicle

Page 16: Traffic Modeling Final Report

14

Figure 13: Average accepted lead and lag gaps during lane change We see from the graph that the gaps required to change into lane 3 are smaller for both lanes 2 and 4 when compared to the gaps required when changing from lane 2 to 1 or lane 4 to 5. We also see that the gaps required to switch from lane 3 to lane 4 or from lane 3 to lane 2 are the smallest. The closer the vehicles travel, the more probable it is that the vehicles will travel slower. This explains why we see a dip a lower SMS in Lane 3 thus resulting in the dip in flow. The accepted lead and lag gaps for switching between lanes 4-6 are fairly constant thus explaining their similar SMS. The high SMS in Lane 1 is the result of the large lead and lag gap that can be afforded when changing from Lane 2 to 1. This shows that the cars in Lane 1 are farther apart than any other lane, thus traveling at a higher velocity. 4.6 Input-Output Analysis We plotted the number of vehicles entering and leaving the study area in order to determine if there is stand-still traffic at any point in time. Figure 14 shows this analysis.

Figure 14: Number of vehicles entering and leaving study area in 15 minutes

020406080

100120140160180200

1 2 2 3 3 4 4 5 5 6

2 1 3 2 4 3 5 4 6 5

From Lane - To Lane

Gap (

ft)

Lead Gap (ft) Lag Gap (ft)

0

500

1000

1500

2000

2500

3:58:55-4:00 4:00-4:05 4:05-4:10 4:10-4:15 4:15-4:15:37 Volume

Time Period (Minutes)

No.

of

Veh

icle

s

Entering Vehicles Exiting Vehicles

Page 17: Traffic Modeling Final Report

15

We can see from the graph that there is no stand-still traffic at any point in time. The number of cars entering and leaving the study area is equal. 4.7 Spacing Analysis Figure 15 explains spacing between vehicles.

Figure 15: Spacing between vehicles

Spacing represents the distance between the leading vehicle and the subject vehicle. Figure 16 shows a box-plot of the spacing between vehicles.

Figure 16: Box-plot of Spacing The red lines above the 75th percentile represent each individual spacing. We can deduce from the box-plot that the median is likely to be lesser than the mean as the

Spacing

Subject Vehicle

Lead Vehicle

75th Percentile

25th Percentile

Mean

Page 18: Traffic Modeling Final Report

16

fewer but larger spacings are going to pull up the mean. We can also predict that the mode is probably lower than the mean since the vehicles seem to be spaced closer together than farther apart. Figure 17 shows the spacing as a cumulative curve.

Figure 17: CDF Spacing

The CDF validates the box-plot showing that most of the vehicles are closely spaced together. Figure 18 shows the histogram of spacing between vehicles.

Figure 18: Spacing Histogram

Page 19: Traffic Modeling Final Report

17

The maximum spacing is 1321.55 ft. We see that our hypothesis is correct. The mean is 67.85 ft which is smaller than the median 56.57 ft. The mode is also smaller than the mean – 45 ft. Headway provides the time to travel from the front-center of the subject vehicle (at the speed of the subject vehicle) to the front-center of the preceding vehicle. Let us assume the following:

Acceleration = 0 m/s2

Speed = Average SMS = 26.2 ft/s

Thus: Mean Spacing = 67.85 ft

Headway = 67.85/26.2 = 2.59 s

Capacity = 3600/2.59 = 1390 vehicles/h

Ideally, traffic engineers assume the capacity to be 2400 vehicles/h.

Page 20: Traffic Modeling Final Report

18

5 SUMMARY 5.1 Conclusion We see that the road capacity is approximately half that which ideally assumed. This explains the low average SMS of 17.86 mph. Hence, we can conclude that the I-80 is heavily congested. 5.2 Future Work Since the road capacity is half of the ideal road capacity, revision and construction of road plans needs to occur in order to increase the road capacity. The lowered road capacity, close spacing of vehicles, and low SMS suggest that the road is heavily congested. Studies of safety and air pollution need to be conducted in order to assess the full impact of the congestion.

Page 21: Traffic Modeling Final Report

19

6 REFERENCES Cambridge Systematics, Inc. 4:00-4:15 Vehicle Trajectory Data. Cambridge Systematics, Inc. NGSIM I-80 Data Analysis Report. Oakland: 2005 Introduction to Traffic Modeling. Berkshire Regional Planning Commission. 9 May 2007. < http://www.berkshireplanning.org/3/2/6/> Traffic Congestion and Reliability: Linking Solutions to Problems. 10 November 2005. Federal Highway Administration. 9 May 2007. <http://ops.fhwa.dot.gov/congestion_report_04/appendix_B.htm> . Oxford/University of Mississippi Intelligent Transportation System Project. 9 May 2007. < http://oumits.olemiss.edu/research_traffic_count.htm>

Page 22: Traffic Modeling Final Report

20

7 APPENDIX 7.1 C++ Code Format data #include "C314.h" ifstream infile; ofstream outfile; void filereadwrite() { int count = 0; string data; outfile.open("output.txt"); while(!infile.eof()) { infile>>data; count = count + 1; if(count == 18) { outfile<<data<<"\n"; count = 0; } else outfile<<data<<"\t"; } outfile.close(); } void fileopen() { switch (1) {

Page 23: Traffic Modeling Final Report

21

case 1: { infile.open("trajectories-0400-0415.txt", ios::in); filereadwrite(); infile.close(); } case 2: { infile.open("trajectories-0500-0515.txt", ios::in); filereadwrite(); infile.close(); } case 3: { infile.open("trajectories-0515-0530.txt", ios::in); filereadwrite(); infile.close(); } } } void main() { fileopen(); //format file histogram(); //format spacing file from SQL } Format Spacing File void histogram() { string count[25000]; int flag, j = 0, k = 0, tellg = 0, length; char ch; ifstream myfile("spacingout.txt"); ofstream outfile("out.txt"); myfile.seekg(0, ios::end); length = myfile.tellg();

Page 24: Traffic Modeling Final Report

22

myfile.seekg(0, ios::beg); while(tellg != length) { char a[8]; flag = 0; k = 0; ch = '0'; while(ch != ',') { myfile.get(ch); a[k] = ch; k = k + 1; } if(k != 0) { a[k-1] = ' '; for(int i = 0; i<25000; i++) { if(count[i] == a) { flag = 1; i = 25001; } } if(flag == 0) { count[j] = a; outfile<<"count["<<j<<"] = "<<count[j]<<"\n"; j = j + 1; } } tellg = myfile.tellg(); } cout<<"closed file..\n";

Page 25: Traffic Modeling Final Report

23

outfile.close(); myfile.close(); } Header File (C314.h) #ifndef _C314_H #define _C314_H #include <iostream> #include <fstream> #include <string> #include <stdlib.h> #include <cstdlib> #include <windows.h> #include <conio.h> #include <ctype.h> #include <process.h> #include <sstream> #include <stdio.h> using namespace std; void filereadwrite(); void fileopen(); void histogram(); #endif

Page 26: Traffic Modeling Final Report

24

7.2 Data Tables Time Period Analysis

Time Period Flow (vph) TMS (mph) SMS

(mph) 4:00-4:05pm 8436 23.44 20.01 4:05-4:10pm 7968 22.13 17.82 4:10-4:15pm 8028 20.95 15.64

Average 8144 22.19 17.86 Lane Analysis

Lane Flow (vph) TMS (mph) SMS

(mph) 1 1420 40.2 30.03 2 1414 18.81 20.28 3 1170 18.14 20.55 4 1278 17.33 14.5 5 1306 19.21 15.18 6 1556 18.21 14.41

Average 1357 22.16 19.17 Percentage End Lane Distrubition by Starting Lane

Ending Lane Starting Lane 1 2 3 4 5 6

1 95.24% 2.80% 1.12% 0.56% 0.00% 0.28% 2 2.72% 90.94% 4.53% 0.30% 0.00% 1.51% 3 1.84% 16.91% 75.00% 4.04% 0.74% 1.47% 4 0.64% 8.33% 19.87% 65.71% 3.21% 2.24% 5 0.00% 1.68% 7.07% 26.26% 55.22% 9.76% 6 0.00% 0.00% 0.68% 4.44% 25.26% 69.62%

Page 27: Traffic Modeling Final Report

25

Accepted Lead and Lag Gaps During Lane Change

From Lane To Lane Lead Gap (ft) Lag Gap (ft) Total Gap (ft) 2 1 41.15 20.28 61.43 1 2 99.37 90.92 190.29 3 2 40.19 47.33 87.52 2 3 29.6 39.45 69.05 4 3 35.8 31.98 67.78 3 4 37.45 46.92 84.37 5 4 49.93 52.76 102.69 4 5 30.87 38.25 69.12 6 5 35.81 49.43 85.24 5 6 35.13 51.94 87.07

Input-Output Analysis

3:58:55-4:00 4:00-4:05 4:05-4:10 4:10-4:15 4:15-4:15:37 Volume On-Ramp Flow 1 62 64 64 0

Entering - Freeway Lane 53 633 622 553 0 Exiting - Freeway Lane 0 657 653 674 68

Entering Vehicles 54 695 686 617 0 2052 Exiting Vehicles 0 657 653 674 68 2052