Microscopic Traffic Simulation

Lecture Notes in Transportation Systems Engineering

Prof. Tom V. Mathew
 
PDF for Online View or PDF for Print  
(PDF for IITB students and is password protected)

Contents

1 Overview
2 Traffic Simulation Models
 2.1 Need for simulation
 2.2 Applications
 2.3 Classifications
3 Building Traffic Simulator
 3.1 Model development
  3.1.1 Numerical example
  3.1.2 Numerical example
 3.2 Model calibration
  3.2.1 Numerical example
 3.3 Determination of Errors
  3.3.1 Numerical example
 3.4 Model Verification
 3.5 Model Validation
4 Simulation Packages
5 Conclusion
Exercises
References
Acknowledgments
______________________________________________________________________

1 Overview

The complexity of traffic stream behaviour and the difficulties in performing experiments with real world traffic make computer simulation an important analysis tool in traffic engineering. The physical propagation of traffic flows can be specifically described using traffic flow models. By making use of different traffic simulation models, one can simulate large scale real-world situations in great detail. Depending on the level of detailing, traffic flow models are classified into macroscopic, mesoscopic and microscopic models. Macroscopic models view the traffic flow as a whole whereas microscopic ones gives attention to individual vehicles and their interactions while the mesoscopic models fall in between these two. This chapter gives an overview of the basic concepts behind simulation models and elaboration about the microscopic approach for modelling traffic.

A microscopic model of traffic flow attempts to analyze the flow of traffic by modelling driver-driver and driver-road interactions within a traffic stream which respectively analyses the interaction between a driver and another driver on road and of a single driver on the different features of a road. Many studies and researches were carried out on driver’s behavior in different situations like a case when he meets a static obstacle or when he meets a dynamic obstacle. Among these, the pioneer development of car following theories paved the way for the researchers to model the behaviour of a vehicle following another vehicle in the 1950s and 1960s.

2 Traffic Simulation Models

Simulation modelling is an increasingly popular and effective tool for analyzing a wide variety of dynamical problems those associated with complex processes which cannot readily be described in analytical terms. Usually, these processes are characterized by the interaction of many system components or entities whose interactions are complex in nature. Specifically, simulation models are mathematical/logical representations of real-world systems, which take the form of software executed on a digital computer in an experimental fashion. The most important advantage is that these models are by no means exhaustive.

2.1 Need for simulation

Traffic simulation models have a large variety of applications in the required fields. Now-a-days they become inevitable tools of analysis and interpretation of real world situations especially in Traffic Engineering. The following are some situations where these models can find their scope.

  1. When mathematical or analytical treatment of a problem is found infeasible or inadequate due to its complex nature.
  2. When there is some doubt in the mathematical formulation or results.
  3. When there is a need of an animated view of flow of vehicles to study their behaviour.

It is important to note that simulation can only be used as an auxiliary tool for evaluation and extension of results provided by other conceptual or mathematical formulations or models.

2.2 Applications

Traffic simulations models can meet a wide range of requirements:

  1. Evaluation of alternative treatments
  2. Testing new designs
  3. As an element of the design process
  4. Embed in other tools
  5. Training personnel
  6. Safety Analysis

2.3 Classifications

Traffic simulation models can be classified based on different criteria. Figure 1 shows various types of classification. In a broader sense, they can be categorized into continuous and discrete ones according to how the elements describing a system change their states. The latter is again classified into two.


PIC

Figure 1: Classification of Traffic simulation models


The first, divides time into fixed small intervals and within each interval the simulation model computes the activities which change the states of selected system elements. For some specific applications, considerable savings in computational time can be achieved by the use of event based models where scanning is performed based on some abrupt changes in the state of the system (events). However the discrete time models could be a better choice where the model objectives require more realistic and detailed descriptions.

According to the level of detailing, simulation models can be classified into macroscopic, mesoscopic and microscopic models. A macroscopic model describes entities and their activities and interactions at a low level of detail. Traffic stream is represented in an aggregate measure in terms of characteristics like speed, flow and density. A mesoscopic model generally represents most entities at a high level of detail but describes their activities and interactions at a much lower level of detail. A microscopic model describes both the system entities and their interactions at a high level of detail. Car following models and lane changing models are some significant examples. The choice of a particular type of model depends on the nature of the problem of interest.

Depending on the type of processes represented by the model, there are deterministic and stochastic models. Models without the use of any random variables or in other words, all entity interactions are defined by exact mathematical/logical relationships are called deterministic models. Stochastic models have processes which include probability functions.

3 Building Traffic Simulator

The basic steps involved in the development are same irrespective of the type of model. The different activities involved are the following.

  1. Define the problem and the model objectives
  2. Define the system to be studied - Roadway, Vehicle and Driver characteristics
  3. Model development
  4. Model calibration
  5. Model verification
  6. Model validation
  7. Documentation

The most significant steps among the above are described with the help of stating the procedure for developing a microscopic model.

3.1 Model development

The framework of a model consists of mainly three processes as mentioned below.

  1. Vehicle generation
  2. Vehicle position updation
  3. Analysis

The flow diagram of a microscopic traffic simulation model is given in Figure 16.2. The basic structure of a model includes various component models like car following models like car following models, lane changing models etc. which come under the vehicle position updation part. In this chapter, the vehicle generation stage is explained in detail. The vehicles can be generated either according to the distributions of vehicular headways or vehicular arrivals. Headways generally follow one of the following distributions.

  1. Negative Exponential Distribution (Low flow rate)
  2. Normal Distribution (High flow rate)
  3. Erlang Distribution (Intermediate flow rate)

The generation of vehicles using negative exponential distribution is demonstrated here. The probability distribution function is given as follows.

f (x) = λe-λx
(1)

From the above equation, the expression for exponential variate headway X can be derived as:

X = μ(- log  R)
          e
(2)

where, μ is the mean headway, R is the random number between 0 and 1


PIC

Figure 2: Flow diagram of a Microscopic traffic simulation model


Random number generation is an essential part in any stochastic simulation model, especially in vehicle generation module. Numerous methods in terms of computer programs have been devised to generate random numbers which appear to be random. This is the reason why some call them pseudo-random numbers. Therefore headways can be generated using the above expression by giving a random number and the mean headway as the input variables.

In a similar way, the vehicular arrival pattern can be modeled using Poisson’s distribution. The probability mass function is given as:

        x -λ
p(x) = λ-e---
        x!
(3)

where, p(x) is the probability of x vehicle arrivals in an interval t, λ is the mean arrival rate of vehicles If the probability of no vehicle in the interval t is given as p(0), then this probability is same as the probability that the headway greater than or equal to t.

3.1.1 Numerical example

Given flow rate is 900 veh/hr. Simulate the vehicle arrivals for 1 min using negative exponential distribution.

Solution Step 1: Calculate the mean headway μ = ----1---
(900∕3600) = 4sec. Step 2: Generate the random numbers between 0 and 1. Step 3: Calculate the headways and then estimate the cumulative headways. The calculations are given in Table 1

X = μ(- logeR )






Veh. No. R X Arrival time (sec)




1 0.73 1.23 1.23




2 0.97 0.14 1.37




3 0.27 5.26 6.63




4 0.44 3.25 9.88




5 0.52 2.63 12.51




6 0.77 1.05 13.55




7 0.43 3.39 16.94




8 0.81 0.84 17.79




9 0.08 9.96 27.75




10 0.74 1.18 28.93




11 0.53 2.58 31.51




12 0.81 0.83 32.34




13 0.15 7.46 39.80




14 0.44 3.26 43.06




15 0.29 5.02 48.08




16 0.68 1.56 49.63




17 0.0512.09 61.72





Table 1: Vehicle arrivals using Negative exponential distribution

3.1.2 Numerical example

The hourly flow rate in a road section is 900 veh/hr. Use Poisson distribution to model this vehicle arrival for 10 min.

Solution Step 1: Calculate the no. of vehicles arriving per min. λ = 900/60 = 15 veh/min. Step 2: Calculate the probability of 0, 1, 2, ... vehicles per minute using Poisson distribution formula. Also calculate the cumulative probability as shown below.

       λxe-λ
p(x) = -x!---

Step 3: Generate random numbers from 0 to 1. Using the calculated cumulative probability values, estimate the no. of vehicles arriving in that interval as shown in Table below.





n p(x=n)p(x¡=n)



0 0.000 0



1 0.000 0.000



2 0.000 0.000



3 0.000 0.000



4 0.001 0.001



5 0.002 0.003



6 0.005 0.008



7 0.010 0.018



8 0.019 0.037



9 0.032 0.070



10 0.049 0.118



11 0.066 0.185



12 0.083 0.268



13 0.096 0.363



14 0.102 0.466



15 0.102 0.568



16 0.096 0.664



17 0.085 0.749



18 0.071 0.819



19 0.056 0.875



20 0.042 0.917




Table 2: Calculation of probabilities using Poisson distribution





t (min) R n



1 0.231 11



2 0.162 10



3 0.909 19



4 0.871 18



5 0.307 12



6 0.008 6



7 0.654 15



8 0.775 17



9 0.632 15



10 0.901 20



143




Table 3: Vehicle arrivals using Poisson distribution

Here the total number of vehicles arrived in 10 min is 143 which is almost same as the vehicle arrival rate obtained using negative exponential distribution.

3.2 Model calibration

The activity of specifying data to the model that describes traffic operations and other features which are site specific is called calibration of the model. In other words, calibration is the process of quantifying model parameters using real-world data. This data may take the form of scalar elements and of statistical distributions. Calibration is a major challenge during the implementation stage of any model. The commonly used methods of calibration are regression, optimization, error determination, trajectory analysis etc. A brief description about various errors and their significance is presented in this section. The optimization method of calibration is also explained using the following example problem.

3.2.1 Numerical example

The parameters obtained in GM car-following model simulation are given in Table below. Field observed values of acceleration of follower is also given. Calibrate the model by finding the value of α. Assume l=1 and m=0. Use optimization method to solve the problem.





Observed Acceleration (aobs)Velocity difference, dvDistance headway, dx



0.23 1.5 29.13



0.46 1.88 29.97



0.67 1.16 30.73



0.82 0.32 31.10




Table 4: Parameters of GM Model

Solution Step 1: Formulate the objective function (z).

            4
Minimize z = ∑ (aobs- acal)2.
           i=1  i     i

Step 2: Express aical in terms of α. As per GM model (since l=1 and m=0),

      α × dv
acial= ------
        dx

Step 3: Therefore the objective function can be expressed as:

z = (0.23 - 0.05α)2 + (0.46 - 0.06α)2 + (0.67 - 0.04α)2 + (0.82 - 0.01α)2

Step 4: Since the above function is convex, differentiating and then equating to zero will give the solution (as stationary point is the global minimum). Differentiating with respect to and equating to zero,

dz-= 0
dα

Then, value of α is obtained as 9.74.

3.3 Determination of Errors

Most of the available commercial traffic simulation software provides advanced user-friendly graphic user interfaces with flexible and powerful graphic editors to assist analysts in the model-building process. This reduces the number of errors. There are a number of manual ways to quantify the error associated with every parameter while calibrating them. Some of the common measures of error and their expressions are discussed below.

  1. Root mean square error
             ∘ -----------------
           1-              2
RM  SE =   N Σi=1N (xi - yyi)
    (4)

  2. Root mean squared normalized error
               ∘ -1-------xi --yi-
RM  SN E =   N-Σi=1N (--y---)2
                         i
    (5)

  3. Mean error
           1
M E =  N-Σi=1N(xi - yi)
    (6)

  4. Mean normalized error
    M N E = -1Σi=1N (xi --yi)
        N          yi
    (7)

where, xi is the ith measured or simulated value, yi is the ith observed value

The above error measures are useful when applied separately to measurements at each location instead of to all measurements jointly. They indicate the existence of systematic bias in terms of under or over prediction by the simulation model. Taking into account that the series of measurements and simulated values can be collected at regular time intervals, it becomes obvious that they can be interpreted as time series and, therefore, used to determine how close the simulated and the observed values are. Thus it can be determined that how similar both time series are. On the other hand, the use of aggregated values to validate a simulation seems contradictory if one takes into account that it is dynamic in nature, and thus time dependent. Theil defined a set of indices aimed at this goal and these indices have been widely used for that purpose. The first index is Theil’s indicator, U (also called Theil’s inequality coefficient), which provides a normalized measure of the relative error that reduces the impact of large errors:

          ∘ ----------------
             1Σi=1N (xi - yi)2
U =  ∘-------N------∘--------------
       1NΣi=1N (xi)2 +  N1Σi=1N (yi)2
(8)

The global index U is bounded, 0 U 1, with U = 0 for a perfect fit and xi = yi for i = 1 to N, between observed and simulated values. For U 0.2, the simulated series can be accepted as replicating the observed series acceptably well. The closer the values are to 0, the better will be the model. For values greater than 0.2, the simulated series is rejected.

3.3.1 Numerical example

The observed and simulated values obtained using Model 1 and Model 2 are given in Table below.


Table 5: Observed and Simulated values




Simulated values, x



Observed values, yModel 1 Model 2



0.23 0.2 0.27



0.46 0.39 0.5



0.67 0.71 0.65



0.82 0.83 0.84




  1. Comment on the performance of both the models based on the following error measures - RMSE, RMSNE, ME and MNE.
  2. Using Theil’s indicator, comment on the acceptability of the models.

Solution

  1. Using the formulas given below (Equations 16.4, 16.5, 16.6, 16.7), all the four errors can be calculated. Here N = 4.
             ∘ -----------------
RM  SE =   1-Σi=1N (xi - yyi)2
           N

               ∘ -1-------xi --yi-
RM  SN E =   N-Σi=1N (--yi--)2

    M E =  1-Σi=1N(xi - yi)
       N

    M N E = N1Σi=1N (xi -yiyi)

    Tabulations required are given below.



    Table 6: Error calculations for Model 1

    Model 1








    (x - y) (x-y
 y) (x - y)2 (x-y
 y)2




    -0.030 -0.130 0.0009 0.0170




    -0.070 -0.152 0.0049 0.0232




    0.040 0.060 0.0016 0.0036




    0.010 0.012 0.0001 0.0001




    ϵ = -0.050 ϵ = -0.211 ϵ = 0.0075 ϵ = 0.0439




    ME = 0.013MNE = 0.053RMSE = 0.043RMSNE = 0.105







    Table 7: Error calculations for Model 2

    Model 2








    (x - y) (x-y
 y) (x - y)2 (x-y
 y)2




    0.040 0.174 0.0016 0.0302




    0.040 0.087 0.0016 0.0076




    -0.020 -0.030 0.0004 0.0009




    0.020 0.024 0.0004 0.0006




    ϵ = 0.080 ϵ = 0.255 ϵ= 0.0040 ϵ = 0.0393




    ME = 0.020MNE = 0.064RMSE = 0.032RMSNE = 0.099





    Comparing Model 1 and Model 2 in terms of RMSE and RMSNE, Model 2 is better. But with respect to ME and MNE, Model 1 is better.

  2. Theil’s indicator
              ∘ ----------------
    --------N1Σi=1N-(xi --yi)2-----
U = ∘ -1---------2  ∘ -1---------2
      N Σi=1N (xi) +   N Σi=1N (yi)

    The additional tabulations required are as follows:



    Table 8: Theil’s indicator calculation




    x2



    Model 1 Model 2 y2



    0.04 0.0729 0.0529



    0.1521 0.25 0.2116



    0.5041 0.4225 0.4489



    0.6889 0.7056 0.6724



    ϵ = 1.3851ϵ = 1.451ϵ = 1.3858




    The value of Theil’s indicator is obtained as: For Model 1, U = 0.037 which is 0.2, and For Model 2, U = 0.027 which is 0.2. Therefore both models are acceptable.

3.4 Model Verification

Following de-bugging, verification is a structured regimen to provide assurance that the software performs as intended. Since simulation models are primarily logical constructs, rather than computational ones, the analyst must perform detailed logical path analyses. When completed, the model developer should be convinced that the model is performing in accord with expectations over its entire domain of application.

3.5 Model Validation

Validation is the process to determine whether the simulation model is an accurate representation of the system under study. This establishes that the model behaviour accurately and reliably represents the real-world system being simulated, over the range of conditions anticipated and it involves the following major steps.

  1. Acquiring and formatting real world data
  2. Establishing the validation criteria - Hypotheses, Statistical tests etc.
  3. Experimental design for validation including a variety of scenarios
  4. Perform validation study
  5. Identify the causes of failure if any and repair the model accordingly

The methodological scheme for validation is shown in the following Figure 3.


PIC

Figure 3: Methodological scheme for validation


4 Simulation Packages

Now a days, traffic simulation packages like CORSIM and VISSIM are frequently used as tools for analyzing traffic. VISSIM is a microscopic, time step and behaviour based simulation model developed to analyze the full range of functionally classified roadways and public transportation operations. Since all these are commercial software packages, it is not possible to make sufficient changes in the internal parameters used in these models according to the specific requirements. Common applications of these packages include freeway and arterial corridor studies, sub-area planning studies, evacuation planning, freeway management strategy development, environmental impact studies, Intelligent Transportation Systems (ITS) assessments, current and future traffic management schemes etc.

Results of simulation can be interpreted in different ways. Animation displays of extracting the sought information and insights from the mass of the traffic environment (if available) are a most powerful tool for analyzing simulation results. If the selected traffic simulation lacks an animation feature or if questions remain after viewing the animation, then the following procedures may be adopted:

  1. Execute the model to replicate existing real-world conditions and compare its results with observed behaviour. This ”face validation” can be done to identify model or implementation deficiencies.
  2. Perform ”sensitivity” tests on the study network by varying key variables and observing model responses in a carefully designed succession of model executions.
  3. Plot these results. A review will probably uncover the perceived anomalies

Statistical analysis of the simulation results are also conducted to present point estimates of effectiveness and to form the confidence intervals. Through these processes, one can establish that which simulation system is the best among the different alternatives.

5 Conclusion

It can be observed from the study that using different microscopic simulation models, large scale real-world situations can be simulated in great detail. New applications of traffic simulation can contribute significantly to various programs in ITS. Calibration and validation are the major challenges to be tackled. It is expected that further exploration would open up better opportunities for better utilization and further development of these models.

Exercises

  1. Not Available

References

  1. J Barcelo. Fundamentals of Traffic Simulation. Springer, 2010.
  2. R Kitamura and M Kuwahara. Simulation Approaches in Transportation Analysis. Springer, 2005.
  3. E Lieberman and A K Rathi. Traffic simulation, Traffic flow theory. 1997.
  4. L J Pignataro. Traffic Engineering: Theory and practice. Prentice-Hall, Englewoods Cliffs,N.J., 1973.

Acknowledgments

I wish to thank several of my students and staff of NPTEL for their contribution in this lecture. I also appreciate your constructive feedback which may be sent to tvm@civil.iitb.ac.in

Prof. Tom V. Mathew
Department of Civil Engineering
Indian Institute of Technology Bombay, India

_________________________________________________________________________

Thursday 31 August 2023 12:13:24 AM IST