A Discrete-Event and Hybrid Traffic Simulation Model Based ...

15
Noname manuscript No. (will be inserted by the editor) A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity Yue Zhang · Christos G. Cassandras · Wei Li · Pieter J. Mosterman the date of receipt and acceptance should be inserted later Abstract An intelligent transportation systems (ITS) is a typical cyber-physical system (CPS) in which physical com- ponents, for example, Connected Automated Vehicles (CAVs), are monitored and controlled through a network of cyber and physical components. Such systems, therefore, contain event-driven dynamics along with time-driven dynamics. The proposed discrete-event and hybrid simulation framework based on SimEvents facilitates testing for safety and per- formance evaluation of an ITS and has been used to build a traffic simulation model of the Mcity test facility. It is specifically designed for testing CAVs and contains vari- ous road/lane configurations and a complete instrumentation system. This enables users to study traffic at the microscopic level, including the effectiveness of new control algorithms for CAVs under different traffic scenarios, the event-driven aspects of transportation systems, and the effects of com- munication delays. The framework spans multiple toolboxes including MATLAB R , Simulink R , and SimEvents R . 1 Introduction An Intelligent Transportation System (ITS) combines time- driven dynamics governing its physical components with event- driven dynamics characterizing its cyber elements. The phys- ical components include the vehicles, infrastructure, pedes- trians, and so on. The cyber components involve a variety of devices and software modules for sensing, monitoring, and actuation, which altogether provide the capability for infor- mation processing, control, and communication. Supported in part by NSF under grants ECCS-1509084 and CNS- 1645681, by AFOSR under grant FA9550-12-1-0113, by ARPA-E’s NEXTCAR program under grant DE-AR0000796, and by Bosch, Honda R&D Americas, and MathWorks. Address(es) of author(s) should be given Connected Automated Vehicles (CAVs), which possess the potential to drastically change the transportation land- scape, are at the heart of an ITS. The advent of CAVs pro- vides the automotive industry and transportation network developers with an unprecedented opportunity by enabling users to better measure, control, and monitor the conditions of a transportation system, hence improving traffic condi- tions in terms of maintaining safety, reducing energy con- sumption and emissions, while also reducing congestion. From the perspective of a CAV, the physical domain is de- fined by vehicle mechanics, motion dynamics, energy con- sumption models, etc., while the cyber domain involves the capability to sense the surroundings, communicate through Vehicle-to-Vehicle (V2V) or Vehicle-to-Infrastructure (V2I) networking capabilities, and implement intelligent control algorithms. Recent advances in CAVs focus on issues such as opti- mizing powertrain configurations, for instance, in managing the gas/electricity-powered components of plug-in hybrid electric vehicles (PHEV), as well as improving traffic con- ditions in terms of reducing travel delays and energy con- sumption. Examples include Lee and Park (2012), where the overlap between vehicle positions is minimized, and Gilbert (1976); Hooker (1988); Hellstr¨ om et al. (2010); Li et al. (2012) where the focus is on improving energy economy. To evaluate the effectiveness of emerging proposed method- ologies, it is important to conduct field tests involving actual vehicles as discussed in Shladover et al. (1991) and Kato et al. (2002). Such tests take actual environmental factors into consideration, thus lending them credibility. The Mc- ity test facility(https://mcity.umich.edu/our-work/m city-test-facility/) is specifically designed for test- ing CAVs under safe and realistic conditions. It is a full- scale reproduction of an urban-suburban environment en- compassing various road/lane configurations and a complete instrumentation system. Mcity is located at the University of

Transcript of A Discrete-Event and Hybrid Traffic Simulation Model Based ...

Page 1: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

Noname manuscript No.(will be inserted by the editor)

A Discrete-Event and Hybrid Traffic Simulation Model Based onSimEvents for Intelligent Transportation System Analysis in Mcity

Yue Zhang · Christos G. Cassandras · Wei Li · Pieter J. Mosterman

the date of receipt and acceptance should be inserted later

Abstract An intelligent transportation systems (ITS) is atypical cyber-physical system (CPS) in which physical com-ponents, for example, Connected Automated Vehicles (CAVs),are monitored and controlled through a network of cyberand physical components. Such systems, therefore, containevent-driven dynamics along with time-driven dynamics. Theproposed discrete-event and hybrid simulation frameworkbased on SimEvents facilitates testing for safety and per-formance evaluation of an ITS and has been used to builda traffic simulation model of the Mcity test facility. It isspecifically designed for testing CAVs and contains vari-ous road/lane configurations and a complete instrumentationsystem. This enables users to study traffic at the microscopiclevel, including the effectiveness of new control algorithmsfor CAVs under different traffic scenarios, the event-drivenaspects of transportation systems, and the effects of com-munication delays. The framework spans multiple toolboxesincluding MATLAB R©, Simulink R©, and SimEvents R©.

1 Introduction

An Intelligent Transportation System (ITS) combines time-driven dynamics governing its physical components with event-driven dynamics characterizing its cyber elements. The phys-ical components include the vehicles, infrastructure, pedes-trians, and so on. The cyber components involve a variety ofdevices and software modules for sensing, monitoring, andactuation, which altogether provide the capability for infor-mation processing, control, and communication.

Supported in part by NSF under grants ECCS-1509084 and CNS-1645681, by AFOSR under grant FA9550-12-1-0113, by ARPA-E’sNEXTCAR program under grant DE-AR0000796, and by Bosch,Honda R&D Americas, and MathWorks.

Address(es) of author(s) should be given

Connected Automated Vehicles (CAVs), which possessthe potential to drastically change the transportation land-scape, are at the heart of an ITS. The advent of CAVs pro-vides the automotive industry and transportation networkdevelopers with an unprecedented opportunity by enablingusers to better measure, control, and monitor the conditionsof a transportation system, hence improving traffic condi-tions in terms of maintaining safety, reducing energy con-sumption and emissions, while also reducing congestion.From the perspective of a CAV, the physical domain is de-fined by vehicle mechanics, motion dynamics, energy con-sumption models, etc., while the cyber domain involves thecapability to sense the surroundings, communicate throughVehicle-to-Vehicle (V2V) or Vehicle-to-Infrastructure (V2I)networking capabilities, and implement intelligent controlalgorithms.

Recent advances in CAVs focus on issues such as opti-mizing powertrain configurations, for instance, in managingthe gas/electricity-powered components of plug-in hybridelectric vehicles (PHEV), as well as improving traffic con-ditions in terms of reducing travel delays and energy con-sumption. Examples include Lee and Park (2012), where theoverlap between vehicle positions is minimized, and Gilbert(1976); Hooker (1988); Hellstrom et al. (2010); Li et al.(2012) where the focus is on improving energy economy.To evaluate the effectiveness of emerging proposed method-ologies, it is important to conduct field tests involving actualvehicles as discussed in Shladover et al. (1991) and Katoet al. (2002). Such tests take actual environmental factorsinto consideration, thus lending them credibility. The Mc-ity test facility(https://mcity.umich.edu/our-work/mcity-test-facility/) is specifically designed for test-ing CAVs under safe and realistic conditions. It is a full-scale reproduction of an urban-suburban environment en-compassing various road/lane configurations and a completeinstrumentation system. Mcity is located at the University of

Page 2: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

2 Yue Zhang et al.

Michigan’s North Campus, with more than 16 acres of roadsand infrastructure. However, field test beds such as Mcityare not widely available to researchers and CAV technologydevelopers. With simulation still the prevailing way for per-forming experiments with CAVs, a suitable ITS simulationenvironment that can accommodate various traffic scenariosis indispensable.

Transportation system models are normally viewed atdifferent levels of detail, hence they are classified into threetypes: macroscopic, mesoscopic, and microscopic models(Ferrara et al. (2018)). Macroscopic models generally dealwith transportation elements at an aggregate level and viewtraffic as a collection of interacting flow processes. Meso-scopic models consider and analyze individual transporta-tion elements as small groups within which all elementsare considered to be homogeneous (e.g., vehicle platoons).Microscopic models focus on individual elements, such asthe implementation of traffic control or communication pro-tocols and how they impact vehicle motion dynamics anddriving behavior. The focus of this paper is on building mi-croscopic models allowing the evaluation of different infor-mation and communication technologies (ICT) and controlalgorithms as they are implemented at individual vehicles.

There are many traffic simulation platforms that can op-erate at the microscopic level, such as VISSIM (Fellendorf(1994)), PARAMICS (Cameron and Duncan (1996)), CAR-SIM (Benekohal and Treiterer (1988)) and SUMO (Krajzewiczet al. (2002)), all of which offer a wide range of methodsto design and evaluate traffic systems. Microscopic mod-els track individual transportation elements on a continuous-time basis; for instance, they must track the position of allvehicles all the time. Therefore, most of the microscopicmodels rely on continuous-time simulation. However, trans-portation systems must respond to events, some of which arerandom, such as vehicle arrivals, bad weather, sudden brak-ing of a vehicle, or a pedestrian crossing in an unsignalizedarea, while others are controllable, such as routing decisionsor traffic light switches. Consequently, traffic models mustbe both event-driven and time-driven.

The emergence of CAVs in an ITS has motivated addi-tional features for existing simulation platforms. In particu-lar, CAVs make use of more sophisticated and increasinglyefficient control algorithms that heavily rely on sensing thetransportation environment (for instance, unexpected pedes-trian crossing and monitoring inter-vehicle distances to en-sure safety). Instrumental in the operation of an ITS withCAVs is also V2I and V2V communication, which presentschallenges in terms of the quality and reliability of suchcommunication. Testing and validating such new function-alities requires the consideration of a large number of differ-ent traffic scenarios. Designing appropriate simulation plat-forms is challenging, since it requires an environment thatencompasses all different aspects of ITS operation. An ex-

ample of such a platform is PreScan, which accommodatesCAVs and Advanced Driver Assistance Systems (ADAS)based on sensor simulation and flexible scenario definition.After building a scenario from a set of template compo-nents, one can set vehicle models and implement controlalgorithms via a MATLAB R© (MathWorks R© (2016b)) andSimulink R© (MathWorks R© (2016d)) interface. The tool ITSModeller proposed in Versteegt et al. (2009) complementsPreScan in terms of evaluation at a traffic network level.

One common feature of the aforementioned traffic simu-lation platforms is the integration of MATLAB and Simulinkmodules via an interface that allows users to design ICTmethods and control algorithms. Examples can be found inZhang et al. (2016), where a decentralized optimal controlalgorithm is implemented using MATLAB and applied toeach vehicle, with the resulting vehicle behavior visualizedand evaluated through VISSIM. This illustrates the powerfulcapabilities of MATLAB and Simulink as a test bed for ICTapproaches and control algorithms. In addition, SimEvents R©

(MathWorks R© (2016c)) provides users with various paradigmsfor building a discrete-event simulation model. This papertakes advantage of the Discrete Event System (DES) simu-lation framework introduced in SimEvents. This new frame-work offers users access to both graphical and textual mod-eling languages to create customized DES models. Com-bined with the discrete-event/continuous-time hybrid simu-lation engine of the original SimEvents (Clune et al. (2006)),a single simulation model can include both discrete-eventcomponents implemented by SimEvents and continuous-timecomponents implemented by Simulink. This makes MAT-LAB and Simulink a highly attractive platform for ITS sim-ulation.

Earlier work in Zhang et al. (2017a) and Zhang et al.(2018) introduced a new discrete-event and hybrid trafficsimulation framework for ITSs using SimEvents in conjunc-tion with MATLAB and Simulink. This framework offersaccess to both the physical components (e.g., vehicle mo-tion dynamics) and the cyber components which typicallyinvolve different ICT approaches and control strategies. Thesimulation model consists of two parts: (1) the continuous-time component for vehicle simulation, for instance, vehiclemotion tracking, and (2) the discrete-event part, for instance,a change in driving behavior when a traffic light turns red.Thus, the overall traffic simulation framework is based on ahybrid dynamic model.

An important feature of the proposed traffic simulationframework is the capability for users to easily create differ-ent scenarios under which they can test various ICT methodsand control algorithms. This paper builds upon the discrete-event and hybrid traffic simulation framework in Zhang et al.(2018) in order to create a flexible hybrid simulation modelfor Mcity. The resulting simulation model allows combin-ing the flexibility of SimEvents for creating different sce-

Page 3: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 3

narios with the advantages of Mcity that encompasses vari-ous road/infrastructure configurations. Several examples arepresented to describe and elaborate on the capabilities of thishybrid simulation framework and demonstrate how it canoperate under various traffic scenarios. In particular, we dis-cuss three central scenarios: (1) CAVs crossing unsignalizedintersections, (2) CAVs crossing signalized intersections, (3)CAVs merging at a freeway on-ramp. In addition, to empha-size the event-driven nature of transportation systems, weexplore a few possible events that may occur in traffic net-works and affect vehicle behavior. To demonstrate the po-tential of integrating communication technologies, we alsostudy the impact of communication delays on safety.

The paper is structured as follows. Section 2 reviewsthe hybrid traffic simulation framework introduced in Zhanget al. (2017a) and Zhang et al. (2018). Section 3 discussesin detail the implementation of the hybrid traffic simulationplatform using SimEvents in conjunction with MATLABand Simulink. Section 4 briefly introduces the Mcity testfacility and its implementation in SimEvents. Sections 5-9elaborate on the capabilities of the traffic simulation plat-form by demonstrating different scenarios in Mcity. Section10 concludes with remarks and an outline of further researchactivities.

2 A Discrete-Event And Hybrid Traffic SimulationFramework

For ICT methods and control algorithms, a traffic simula-tion framework offers a test bed for analyzing vehicle be-havior under various traffic scenarios, for instance, avoidinga potential rear-end collision, stopping before a red light, orfollowing the preceding vehicle. To create a traffic simula-tion framework for vehicle behavior evaluation, we need tobuild a closed-loop system that consists of physical elements(infrastructure and vehicles) and a control network for traf-fic management using wireless, fiber optics, Ethernet, andkinematic positioning systems. Events should be consideredas they may affect the operation of the traffic system. Thesimulation framework should consist of two parts: the con-tinuous (time-driven) part, for instance, vehicle movementtracking; and the discrete-event part, for instance, an unex-pected pedestrian crossing. The system is designed to com-prise various elements of the SimEvents paradigm such asentities, queues, servers, terminators, and customized MAT-LAB Discrete Event Systems.

The model introduced in Zhang et al. (2017a) is brieflyreviewed in what follows. There are three basic elements inthe hybrid traffic simulation framework: infrastructure, ve-hicles, and events.Infrastructure consists of roadways and roadside facilities(Table 1) that enable communication and carry out trafficmanagement allowing vehicles to operate.

Fig. 1 Architecture of the hybrid traffic simulation framework.

Vehicles can differ in motion dynamics, driver behavior mod-els, fuel consumption dynamics, and so on (Table 2). ForCAVs, they should also possess the ability to communicatewith each other.Events in hybrid systems can be categorized into two classes:exogenous and endogenous. Exogenous events include thoseoriginating in the outside world and forcing certain elementsto change their behavior. For instance, an unexpected stormmay force the vehicles to decelerate. Endogenous events oc-cur when a time-driven state variable enters a particular set.For instance, the inter-vehicle distance falls below a givenminimum safe following distance, which may indicate a pos-sible impending rear-end crash. Depending on whether theyoccur among vehicles or between vehicles and the infras-tructure (Bettisworth et al. (2015)), the events can also becategorized as listed in Table 3. For instance, “Red Light Vi-olation” occurs when a vehicle crosses an intersection with-out stopping at a red light, which may lead to a possiblecollision.

Figure 1 depicts a typical architecture of the traffic simu-lation framework and shows how different elements are con-nected. Certain elements should be capable of communicat-ing with others, for instance, CAVs can talk to other CAVs(V2V) or to the coordinator (V2I). In this paper, it is as-sumed that only V2I communication is active, as V2V com-munication can be achieved through vehicle-to-infrastructure-to-vehicle (V2I2V) communication. An important feature ofthe proposed framework is the inclusion of communicationdelays, as low packet delays are necessary for implement-ing the time-critical control algorithms employed by CAVs.In Fig. 1, the server modeling blocks are used to model thecommunication delays.

The output of the Events model block provided to thecoordinator indicates that the coordinator module is awareof all the event-based information by means of sensing andcommunication. Once a certain event occurs, the coordina-tor will broadcast or send the information to the vehicles thatmay be affected, so that the vehicles can make appropriatedecisions. For instance, if a rear-end collision occurs nearthe merging zone of an intersection, the coordinator will re-ceive this information through sensors, cameras, or the in-

Page 4: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

4 Yue Zhang et al.

Table 1 Infrastructure

Infrastructure Property Function

Roadway (lanes, pedestrian crossings) length, number of lanes, capacity, etc. guidance, sensingRoadside facilities (traffic lights, stop signs, etc.) control/coordination strategies, range, etc. control, coordination, communication

Table 2 Vehicles

Vehicle Property & Dynamics

Attributes ID, acceleration, speed, position, lane, mpg, etc.Motion dynamics basic model, Kinematic model, Dynamic model, etc.Control dynamics optimal control, model predictive control, etc.Fuel consumption dynamics gasoline engine, electric, hybrid, plug-in hybrid, etc.

Table 3 Events

Vehicle-to-Infrastructure Warning Vehicle-to-Vehicle Warning

Red Light Violation Warning Emergency Electronic Brake Lights (EEBL)Curve Speed Warning Forward Collision Warning (FCW)Stop Sign Gap Assist Intersection Movement Assist (IMA)Spot Weather Impact Warning Left Turn Assist (LTA)Reduced Speed/Work Zone Warning Blind Spot/ Lane Change Warning (BSW/LCW)Pedestrian in Signalized Crosswalk Warning (Transit) Do Not Pass Warning (DNPW)

Vehicle Turning Right in Front of Bus Warning (Transit)

formation sent by other vehicles. As part of safety consid-erations, the coordinator will broadcast the information andCAVs traveling towards this area should decelerate or de-tour.

The continuous or time-driven part in this framework in-cludes vehicle motion dynamics, control dynamics, and fuelconsumption dynamics that should be monitored continu-ously. For the discrete-event part, events are considered asthey can affect vehicle behavior. For instance, if the coordi-nator is aware of an upcoming storm, it will broadcast theinformation and vehicles can then make decisions accord-ingly. Another example arises when a vehicle approaches anintersection and the traffic lights turn red. Such an event mayforce the vehicle to decelerate so as to avoid any traffic lawviolations.

3 Implementation

The hybrid traffic simulation framework described above isbuilt based on MATLAB and Simulink with the inclusion ofvarious programming paradigms (Li et al. (2016)). The in-corporation of SimEvents offers tools to work with discreteevent components. The various programming options offerusers a platform for rapid prototyping that is widely used inthe automotive industry. The paradigm can be selected ac-cording to different modeling contexts. The presented modeluses the following paradigms: Entity Flow, Graphical Pro-

gramming, and Textual Programming. The model structureof a single intersection is shown in Fig. 2.

3.1 Entity Flow

Entities are the discrete items of interest carrying a rich setof attributes, which can pass through a network of queuesand servers during any discrete-event simulation. On the onehand, in the transportation modeling context, an entity canrepresent a vehicle, whose attributes may include the lengthof the vehicle, the maximum acceleration, and so on. Onthe other hand, in the communication modeling context, anentity can represent a packet of transmitted data, which mayconsist of control information and user data (also known asthe payload). An example is shown in the yellow rectangleof Fig. 3, where vehicles are modeled as entities and definedin terms of the following attributes: ID, acceleration, speed,position, lane, destination, and so on.

3.2 Graphical Programming

The graphical programming paradigm enables users to workwith discrete-event components, whereby they can specifyvarious functions associated with events such as entity entryand exit. These are event-driven actions, that is, they canonly be triggered by a different class of events. For instance,in Fig. 3, a series of functions are defined in the red rectangle

Page 5: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 5

Fig. 2 Simulink R© model of an intersection with four road segments(input/outputs).

that can only be executed when the CAV is generated. Thesefunctions specify how the attributes (e.g., speed) of vehiclesare initialized when they are generated.

Fig. 3 Customized event actions of CAV generator block.

3.3 Textual Programming

The MATLAB Discrete Event System provides maximal flex-ibility as it offers users the capability to author an event-driven entity-flow system arbitrarily using object-orientedprogramming in MATLAB (MathWorks R© (2016a)). The func-tionality of a MATLAB Discrete Event System is expand-able by incorporating functions from other MATLAB tool-boxes. The MATLAB Discrete Event System features thefollowing modeling and simulation capabilities:

– The MATLAB Discrete Event System can contain mul-tiple entity storages, while each storage can contain mul-tiple SimEvents entities of a specific type, and is config-ured to sort entities in a certain order.

– An entity or a storage can schedule and execute multipletypes of events such as creating and destroying an entityor iterate over multiple entities in the storage.

– The MATLAB Discrete Event System can take either en-tities or signals (data) as input or output and both built-indata types as well as structured/bus data types are sup-ported.

Fig. 4 The MATLAB R© Discrete Event System for Control Zone (par-tial codes).

– The MATLAB Discrete Event System can be authoredvia a set of MATLAB methods. By implementing thesemethods users can define both structural properties (e.g.,entity types and storage capacity) and dynamic behav-ior of the system (e.g., event triggering conditions andactions taken when an event occurs).

As an example, a MATLAB class-based intersection con-trol zone (CZ) was designed using a MATLAB Discrete EventSystem. The program specifies the properties of the CZ aswell as the definition of different storages that contain user-defined entities, that is, CAVs and information packets (IN-FOs). In addition, different event actions are defined throughmethods. In Fig. 4, the event action associated with the CAVarrival, defined through the method CAVEntryImpl, is to forcethe CAV to send a packet of information to the coordina-tor. The information is packed and sent through the methodINFOGenerateImpl, which further triggers the coordinatorto respond. After the coordinator processes the request andsends the relevant information back, the event INFOEntryoccurs, and the CAV then computes the control policy basedon the information received. To continuously monitor andtrack the status of the CAV, a timer is being called repeat-edly every simulation step, which abstracts the continuoustime-based simulation. The method CAVIterateImpl is usedfor traversing each CAV inside the CZ.

4 Mcity Test Facility

This hybrid traffic simulation framework has been used tobuild a simulation model of the complete Mcity test facility(Fig. 5). The Mcity test facility is specifically designed forperforming experiments with connected and automated ve-hicles under realistic conditions. It is a full-scale reproduc-tion of an urban-suburban environment that includes vari-ous road/lane configurations and an infrastructure, for exam-ple, signalized and unsignalized intersections, roundabouts,a freeway segment, ramps, pedestrian crossings, bike lanes,parking lots (open test areas) and so on. It is also equippedwith an instrumentation system including a control networkfor measuring, monitoring, and controlling the entire traffic

Page 6: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

6 Yue Zhang et al.

Fig. 5 Mcity test facility.

using wireless, fiber optics, Ethernet, and a highly accuratereal-time kinematic positioning system.

Mcity provides an ideal environment for testing new con-trol and communication technologies in a safe and realisticmanner, which is essential for massive deployment of CAVs.With various road/lane configurations and the instrumenta-tion system, it is easy to design and perform experimentsfor different purposes. Therefore, to combine the benefit ofMcity and SimEvents, we have built a hybrid traffic simu-lation framework based on the Mcity layout shown in Fig.6. With this framework, we can carry out simulation exper-iments designed for different specific purposes under vari-ous scenarios. For example, in the signalized intersectionsshown in Fig. 6, we can study the queueing behavior at thecorresponding road segments. To illustrate, Fig. 7 shows thequeue length of road segment 17 (labeled as red in Figs. 5and 6) under fixed-cycle traffic light control. We can alsostudy algorithms that dynamically adjust the green/red cy-cles or control mechanisms that allow CAVs to cross inter-sections without any traffic lights, as discussed in the nextsection.

Another interesting use of the Mcity simulation modelis to conduct field tests with actual vehicles interacting withvirtual (simulated) vehicles when it is impossible or imprac-tical to operate dozens of real vehicles in Mcity itself. In thiscase, one can conduct an experiment with a mix of actualand virtual traffic: there are a few actual vehicles in Mcitythat interact with dozens of virtual vehicles in the simulationmodel. For instance, if a real CAV is being tested for colli-sion avoidance, it may be controlled as if there are vehicles

Fig. 6 The SimEvents-based Mcity simulation platform.

ahead of it and behind it which are in fact perceived by itonly through the simulation model. In this mixed setting, avirtual vehicle ahead of the CAV may communicate its po-sition and speed so that the CAV can sense its presence andpossibly trigger a collision avoidance mechanism (for whatwould be a “virtual” collision).

In terms of studying how CAVs operate in a freeway set-ting, we can use the on-ramp (labeled as yellow in Fig. 6)to study novel control algorithms for CAV merging so asto reduce congestion and improve throughput. In an urbansetting, the multiple intersections (labeled in blue in Fig. 6)can be used in unsignalized fashion to explore the optimalmanner of coordinating vehicles without generating colli-sions. We can also use the signalized intersection (labeled asgreen) to plan a non-stop optimal trajectory for CAVs utiliz-ing signal information. In addition, since the transportationsystem itself is a hybrid system, we can explore its event-driven characteristics by creating an event and studying itsimpact on vehicle behavior. The existing control networkalso provides the potential to perform tests of different infor-mation and communication technologies. As vehicles oftentravel at a high speed, the quality of communication (e.g.,delay, packet loss, and information error rate) is essentialfor maintaining safety and implementing a control algorithmaccurately.

For the rest of the paper, we describe traffic models andassociated implementations for CAVs based on the follow-ing three road/lane configurations: 1) unsignalized intersec-tions, 2) signalized intersections, 3) a freeway on-ramp. Toemphasize the event-driven nature of transportation systems,we also explore a few possible events that may occur in traf-fic networks and affect vehicle behavior. Finally, to demon-

Page 7: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 7

Fig. 7 The queue length of road segment 17.

strate the potential of integrating communication technolo-gies, we study the impact of communication delay on safety.For each simulation setting, the control methodology, if in-volved, is introduced first and then the corresponding demon-stration examples are presented.

5 Unsignalized Intersections

For the unsignalized scenario, only CAVs are being consid-ered. The decentralized optimal control framework, intro-duced in Zhang et al. (2016), is used for optimally control-ling CAVs crossing an urban intersection without any ex-plicit traffic signaling, so as to minimize energy consump-tion subject to a throughput maximization requirement.

As shown in Fig. 8, the region at the center of each in-tersection, called Merging Zone (MZ) is the area of poten-tial lateral CAV collision. Each intersection has a ControlZone (CZ) and a coordinator that can communicate with theCAVs traveling within the CZ. Let N(t) ∈ N be the cumula-tive number of CAVs that have entered the CZ and formeda queue by time t. The way the queue is formed is not re-strictive. Here, an infinite capacity single-server queueingsystem (Cassandras and Lafortune (2009)) following a strictfirst-in-first-out (FIFO) order is assumed. This is relaxed inZhang and Cassandras (2018a) where a dynamic resequenc-ing scheme is used to adjust the vehicle order and improvethroughput. When a CAV reaches the CZ of the intersection,the coordinator assigns it an integer value i = N(t)+ 1. Forsimplicity, each CAV is assumed to be governed by secondorder dynamics

pi(t) = vi(t), pi(t0i ) = 0; vi(t) = ui(t), vi(t0

i ) given (1)

where pi(t) ∈Pi, vi(t) ∈ Vi, and ui(t) ∈Ui denote the posi-tion (i.e., the travel distance from the entry to the CZ), speed,and acceleration/deceleration (control input) of each CAV i.These dynamics are in force over an interval [t0

i , tfi ], where

t0i and t f

i are the times that vehicle i enters the CZ and exitsthe MZ of the intersection, respectively. For the time being,the model is limited by not allowing lane changes or turns.

Fig. 8 Connected Automated Vehicles (CAVs) crossing an urban in-tersection.

To ensure that the control input and vehicle speed arewithin a given admissible range, the following constraintsare imposed:

ui,min ≤ ui(t)≤ ui,max, and

0≤ vmin ≤ vi(t)≤ vmax, ∀t ∈ [t0i , t

mi ],

(2)

where tmi is the time that vehicle i enters the MZ. To ensure

the absence of any rear-end collision throughout the CZ, thefollowing rear-end safety constraint is imposed:

si(t) = pk(t)− pi(t)≥ δ , ∀t ∈ [t0i , t

mi ] (3)

where δ is the minimal safe following distance allowableand k is the CAV physically closest ahead of i.

The objective of each CAV is to derive an acceleration/de-celeration which is optimal in terms of fuel consumptionwithin the CZ. Since the coordinator is not involved in anydecision making on the vehicle control, N(t) decentralizedtractable problems can be formulated that can be solved on-line, that is,

minui∈Ui

12

∫ tmi

t0i

Ki ·u2i dt

s.t.: (1),(2), tmi , pi(tm

i ) = L,

given t0i , vi(t0

i ), pi(t0i ),

(4)

where Ki is a factor to capture CAV diversity (Ki = 1 forsimplicity). The terminal times of all CAVs entering the MZare obtained as the solution to a throughput maximizationproblem formulated in Malikopoulos et al. (2018) subject tothe rear-end and lateral collision avoidance constraints in-side the MZ. Note that this formulation does not include thesafety constraint (3). The conditions under which this con-straint does not become active inside the CZ are provided inZhang et al. (2017b), where it is also shown how they can

Page 8: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

8 Yue Zhang et al.

be enforced through an appropriately designed FeasibilityEnforcement Zone that precedes the CZ.

An analytical solution of problem (4) may be obtainedthrough a Hamiltonian analysis as shown in Malikopouloset al. (2018). Assuming that all constraints are satisfied uponentering the CZ and that they remain inactive throughout[t0

i , tmi ], the optimal control input (acceleration/deceleration)

over t ∈ [t0i , t

mi ] is given by

u∗i (t) = ait +bi (5)

where ai and bi are constants of integration. Using (5) inthe CAV dynamics (1), the optimal speed and position areobtained:

v∗i (t) =12

ait2 +bit + ci (6)

p∗i (t) =16

ait3 +12

bit2 + cit +di, (7)

where ci and di are constants of integration. The coefficientsai, bi, ci, di can be obtained as follows:

16 t3 1

2 t2 t 112 t2 t 1 0

16 (t

mi )

3 12 (t

mi )

2 tmi 1

−tmi −1 0 0

.

aibicidi

=

pi(t)vi(t)

pi(tmi )

λ vi (t

mi )

.

Note that the analytical solution (5) is valid while none of theconstraints becomes active for t ∈ [t0

i , tmi ]. Otherwise, the op-

timal solution is evaluated considering the active constraintsas detailed in Malikopoulos et al. (2018).

5.1 CAVs crossing a single-lane unsignalized intersection

For this scenario, the length of the CZ is set to L = 400mand the length of the MZ to S = 30m. For each direction,only one lane is considered. The minimum safe followingdistance is set to δ = 10m. The vehicle arrivals are assumedto occur according to a Poisson process and the initial speedsare uniformly distributed over [8,12]m/s. A snapshot of thissimulation example is shown in Fig. 9, where the color rep-resents the direction that a vehicle comes from. The readeris also referred to a video demonstration of this simulationwhich can be found at https://drive.google.com/open?id=13pdbysPDdH6F5T7bN22FKwtEQlXPOPUC.

Regarding the communication processes involved, infor-mation is assumed to be exchanged between vehicles and thecoordinator. Every time a CAV enters the CZ, it sends infor-mation to the coordinator indicating its arrival. After a cer-tain period of communication delay, which is modeled us-ing servers, the coordinator sends relevant information backbased on which the CAV can make decisions regarding theremaining travel through the CZ.

For control and performance evaluation purposes, theposition of each CAV must be continuously monitored andtracked (Fig. 10). This represents the continuous time-drivencomponent of the simulation framework. Combined with thediscrete event-driven component (e.g., vehicle arrival events),the two together constitute the hybrid nature of the simula-tion framework.

Fig. 9 CAVs crossing a single-lane unsignalized intersection under op-timal control.

Fig. 10 Control profiles and speed trajectories of CAVs under decen-tralized optimal control framework.

5.2 CAVs crossing a multi-lane unsignalized intersectionincluding turns

For this scenario, we consider a two-lane unsignalized inter-section, where a right turn is only allowed from the right-hand lane and CAVs traveling on the left-hand lane can onlygo straight or turn left. In this case, collision avoidance in-side the MZ including turns becomes more complicated. Toaccount for left and right turns, we modify the terminal timestructure to ensure safety and apply the extension of the so-lution to (5) given in Zhang et al. (2017c). A snapshot of

Page 9: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 9

this simulation example is shown in Fig. 11 and a videodemonstration of the full simulation can be found at https://drive.google.com/open?id=1jr8EPVIgDJCoOSoIv

wpSlnlSxLBAk79Q.

Fig. 11 CAVs crossing an unsignalized intersection (left/right turnsallowed) under optimal control.

5.3 CAVs crossing two adjacent unsignalized intersections

The traffic simulation model is inherently scalable over mul-tiple intersections. To illustrate this, we consider two unsignal-ized intersections as shown in Fig. 12. Note that the two in-tersections can be coupled in different ways depending onthe distance D between them. If D is large compared to thelength of the CZ, that is, D > L, then the two intersectionscan be viewed as independent. However, if the two inter-sections are close, that is, D < L, then they are coupled andwe may view them as a single “double intersection”. For theexample included here, we view the two intersections as in-dependent and no coupling is involved. The intersection dis-tance between the intersections is set to D = L = 400m. Ba-sically, once a CAV exits the upstream MZ, it immediatelyenters the downstream CZ. A snapshot of this simulation ex-ample is shown in Fig. 13. A video demonstration of the fullsimulation can be found at https://drive.google.com/open?id=1L-5ALOw8fzQgDzDVkSSoLOELqx1qwNXv.

6 Signalized Intersections

6.1 CAV non-stop intersection crossing

In this scenario, there are traffic lights present and they arecapable of communicating with other components in the net-work. Each traffic light has a fixed full cycle length T andthree fixed intervals, that is, a green interval G, an amber/yel-low interval A, and a red interval R, where G+A+R = T

Fig. 12 CAVs crossing two adjacent urban intersections.

Fig. 13 CAVs crossing two adjacent urban intersections under optimalcontrol.

Hence, the traffic signal for each direction can be in one ofthree states: (0) red: stop, (1) green: go, (2) amber: go if theCAV can exit the MZ before the signal switches to red, orstop otherwise. Denoting the green, amber, and red states as1, 2, and 0, respectively, the state function l(t) of the trafficsignal l(t) is designed as follows

l(t) =

1, kT ≤ t ≤ kT +G,2 kt +G < t ≤ kt +G+A,0, kt +G+A < t < kt +T ,

(8)

where k ∈ Z≥0 is a non-negative integer.To take full advantage of the signal information based

on V2I communication, a decentralized control frameworkfor optimally controlling a CAV crossing a signalized inter-section is proposed in Meng and Cassandras (2018) so as tominimize both travel time and energy consumption, that is,

minui∈Ui

wt(tmi − t0

i )+wu

∫ tmi

t0i

12

u2i dt

s.t.: (1),(2), pi(tmi ) = L,

given t0i ,vi(t0

i ), pi(t0i ),

(9)

where wt and wu are normalized weights used for trading offbetween minimizing travel time and minimizing energy con-sumption. The optimal terminal time tm

i can then be obtainedfrom the optimization problem. Note that this optimal timetmi may not be feasible under the following circumstances:

(i) the traffic signal is in the red state (or amber state but

Page 10: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

10 Yue Zhang et al.

close to switching time) and/or (ii) a possible rear-end col-lision may occur with the physically preceding CAV k onthe same lane. Since CAV i is able to communicate withboth the traffic light and other CAVs, it can obtain the sig-nal information and the terminal time of CAV k, hence, de-termine the feasible terminal time. The following algorithmdescribes how CAV i determines its optimal and feasible ter-minal time tm

i for crossing the signalized intersection, wheretmk and vm

k are the terminal time and terminal speed for CAVk entering the MZ respectively, and δ is the minimal safefollowing distance.

if l(tmi ) = 1 and tm

i ≥ tmk + δ

vmk

thentmi is feasible

else if l(tmi ) = 1 and tm

i < tmk + δ

vmk

then

set tmi = tm

k + δ

vmk

if l(tmi ) = 1 then

tmi is feasible

elseset tm

i = kT +Tend if

else if not l(tmi ) = 1 and tm

i ≥ tmk + δ

vmk

thenset tm

i = kTif l(tm

i ) = 1 thentmi is feasible

elseset tm

i = kT +Tend if

elseset tm

i = kT +Tend if

Once the terminal time tmi is determined, the problem in (9)

reduces to the problem formulated in the unsignalized sce-nario (Eq. (4)). CAV i can then derive its optimal accelera-tion/deceleration profile.

A snapshot of this simulation example for CAVs cross-ing a signalized intersection is shown in Fig. 14. The signalcycle length is fixed to T = 30s, and the intervals for red,green and amber are set to R = 15s, G = 12s, and A = 3s,respectively. A video demonstration of the full simulationcan be found at https://drive.google.com/open?id=1FDir WNepvQw15duqGx56lBltEur Aq2.

6.2 Non-CAV intersection crossing

To demonstrate the efficiency of new control algorithms, itis necessary to provide comparisons with a baseline scenariowhere vehicles are operated under commonly used modelscapturing human driving behavior. For example, to demon-strate the effectiveness of the optimal control algorithm inMeng and Cassandras (2018), we need to simulate a base-line scenario where the non-CAVs are under traffic light

Fig. 14 CAVs crossing a signalized intersection under optimal control.

control. Models aiming at understanding and modeling hu-man drivers have been reported in the literature (e.g., Liuand Salvucci (2001) and Macadam (2003)). In Zhang andCassandras (2018b), where we explore the interaction be-tween CAVs and non-CAVs, we have used the Wiedemannapproach Wiedemann (1974) to model car-following behav-ior. In the following example, demonstrating the scenariowhere non-CAVs cross a signalized intersection, we applysimple control policies for non-CAVs; specifically, a non-CAV (1) keeps cruising unless an event occurs that wouldaffect its behavior, (2) decelerates when it approaches a redlight, (3) accelerates to a desired speed when the red lightturns green.

A snapshot of a simulation example for the non-CAVscrossing a signalized intersection is shown in Fig. 15. Thesignal settings are the same as those for CAVs crossing. InFig. 15, queues can be observed that gradually form in frontof the red lights.

Fig. 15 Non-CAVs crossing a signalized intersection.

Page 11: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 11

7 Freeway On-Ramp

For freeway on-ramp merging, vehicles traveling on the mainroad are usually prioritized. Therefore, vehicles traveling onthe minor road must slow down or even stop to give way tovehicles on the main road. This stop-and-go behavior greatlyincreases the travel time of the minor road traffic. In addi-tion, as many vehicles need to accelerate hard in order toquickly join the traffic flow on the main road, extra energyis consumed. To deal with this issue, we propose a decen-tralized control framework for optimally controlling a con-tinuous flow of CAVs crossing a freeway merge point, so asto minimize both travel time and energy consumption, thatis,

minui∈Ui

wt(tmi − t0

i )+wu

∫ tmi

t0i

12

u2i (t) dt

s.t.: (1),(2), pi(tmi ) = L,

pi−1(tmi )− pi(tm

i )≥ ρvi(tmi ),

given t0i , vi(t0

i ), pi(t0i ),

(10)

where wt and wu are normalized weights used for trading offbetween minimizing travel time and minimizing energy con-sumption. Note that the issue of collisions at the merge pointis handled by the speed-based safety constraint pi−1(tm

i )−pi(tm

i ) ≥ ρvi(tmi ), where i− 1 is the CAV ahead of i in the

FIFO queue, and ρ denotes the time headway between twovehicles traveling on the same lane (recommended value:ρ = 1.8s according to the rule stated in Vogel (2003)). Asnapshot of this simulation example is shown in Fig. 16.A video demonstration of the full simulation can be foundat https://drive.google.com/open?id=1D2sojOs7kVLGsEnqtU8c8Vk5HlN3bOe-.

Fig. 16 CAVs freeway on-ramp merging.

As demonstrated by the previous examples, the proposedsimulation framework can be easily adapted so as to perform

experiments intended to test vehicle control algorithms un-der various traffic scenarios. Since the simulation frameworkis implemented in an object-oriented fashion, different mod-ules are relatively independent. For instance, if the objectiveis to test a model predictive control algorithm, the only placethat needs to be modified is the vehicle control module; if thegoal is to apply this control algorithm at a roundabout, weonly need to change the road layout to a roundabout module.Similarly, if the objective is to test the impact of communi-cation delays, we can simply adjust the delay module (e.g.,the server modeling blocks in Fig. 2).

8 Event-Driven Scenario

As mentioned in Sec. 2, there are two categories of events:exogenous events that include those originating in the out-side world and force certain elements to change vehicle be-havior and endogenous events that occur when a time-drivenstate variable enters a particular set. To explore event-drivenaspects of transportation systems, we provide two examplesdemonstrating the impact on vehicle behavior of: (1) an ex-ogenous event: a storm, (2) an endogenous event: the inter-vehicle distance between a CAV and the preceding non-CAVfalling below a certain threshold.

8.1 Exogenous event: a storm

The storm example simulates five CAVs crossing an unsignal-ized intersection. For each CAV, the objective is to arrive atthe MZ as soon as possible in an energy-optimal way, asstated in (9). A “storm” is randomly generated from Eventsblocks. An important feature of the optimal solution (5) thatcan be exploited is that the control structure for CAVs re-mains unchanged until an “event” occurs. When the stormevent occurs, the weather conditions force CAVs to take ac-tions that ensure safety. In terms of the change that shouldbe applied to the optimal control problem (9), we reduce thespeed limit vmax. When the storm occurs, if the projectedoptimal trajectory turns out to include intervals violating thespeed limit, the CAV needs to re-solve the optimal controlproblem using the lower speed limit. Note that this may leadto a longer travel time. Given the recursive terminal timestructure derived in Malikopoulos et al. (2018), other CAVsmay also need to recompute their optimal trajectories re-gardless of whether their trajectories violate the speed limitor not.

An example is shown in Fig. 17 containing the speed tra-jectories of five CAVs. The dashed lines represent the pro-jected optimal trajectories along which CAVs intend to pro-ceed before the storm occurs and the solid lines represent thetrajectories that CAVs follow after the storm occurs. Whenthe storm occurs at t = 10s, the speed limit vmax decreases

Page 12: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

12 Yue Zhang et al.

from 15m/s to 13m/s. As the projected optimal trajectoryof CAV #1 (labeled as blue) violates vmax = 13m/s, it re-solves the optimal control problem and proceeds along theupdated trajectory which is strictly constrained by the newspeed limit. In addition, observe that the projected trajecto-ries of CAVs #2-#5 are not affected by the new speed limit.However, since CAV #1 now arrives at the MZ later, the ter-minal times of CAVs #2-#5 are also affected because of therecursive terminal time structure. Hence, CAVs #2-#5 re-compute the trajectories as well given the new terminal timeconstraint.

Note that the change in the speed profiles is only trig-gered by the occurrence of the storm event. Otherwise, CAVswould proceed according to the projected optimal trajecto-ries (dashed lines).

Fig. 17 The speed trajectories of CAVs before (dashed lines) and after(solid lines) a storm event occurs.

8.2 Endogenous event: the inter-vehicle distance fallingbelow a threshold

Clearly, the assumption of 100% CAV traffic is unrealisticas the deployment of fully autonomous vehicles is slow andgradual. Thus, it is necessary to consider mixed-traffic sce-narios as in Fig. 18, where both CAVs and non-CAVs arepresent. Since the non-CAVs are not able to communicatewith other components in the network, we assume that theCAVs can only perceive the existence of a non-CAV throughon-board sensors.

In a mixed-traffic scenario, we use different control algo-rithms to model CAVs and non-CAVs. For CAV i, there aretwo modes it can be in: (i) Free Driving (FD mode) whenit is not constrained by a non-CAV that precedes it and (ii)Adaptive Following (AF mode) when it follows a preced-ing non-CAV, denoted by k, while adaptively maintaining asafe following distance from the non-CAV. In FD mode, the

control objective of each CAV is to derive an optimal accel-eration/deceleration profile in terms of minimizing energyconsumption as in (4). When the inter-vehicle distance be-tween CAV i and non-CAV k falls below a certain thresholdδ f at t1

i and CAV i is traveling at a higher speed compared tonon-CAV k, CAV i transitions from the FD mode to the AFmode. In the AF mode, the control objective of each CAV isto derive an optimal acceleration/deceleration profile so asto minimize energy consumption, while maintaining a min-imum safety following distance δ (δ ≤ δ f ) with the preced-ing non-CAV, that is,

minui∈Ui

12

∫ tmi

t1i

[wu ·u2i (t)+ws(si(t)−δ )2] dt

s.t.: (1),(2), pi(tmi ) = L,

given t1i , vi(t1

i ), pi(t1i ),

(11)

where wu and ws are weights applied to the objective func-tion that allow trading off energy consumption minimiza-tion against maintaining the safety following distance. Thedetails regarding the analytical solution of this problem canbe found in Zhang and Cassandras (2018b). For non-CAVs,simple control policies are assumed, that is, a non-CAV keepscruising if no event occurs that would affect its driving be-havior.

Fig. 18 CAVs (blue labels) and non-CAVs (red labels) crossing an ur-ban intersection.

In the example given below, a non-CAV #1 is cruisingat its initial speed v1(t0

1 ) = 10m/s and CAV #2 enters thesame lane as the non-CAV #1 at t0

2 > t01 (Fig. 19). When

CAV #2 is not constrained by any preceding non-CAV, it isdriving in FD mode and proceeding according to an energy-optimal trajectory (blue curves). When the inter-vehicle dis-tance falls below the minimum safe following distance, thatis, s2(t) ≤ δ f (δ f = 15m), the state change is identified bythe on-board sensors of CAV #2, which triggers the tran-sition of CAV #2 from the FD mode to the AF mode (redcurves). Observe that as CAV #2 is trying to maintain the

Page 13: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 13

safe following distance with the non-CAV #1, it first decel-erates more so as to reach a much lower speed than #1, andthen seeks to keep the minimum safe following distance asclose to δ = 10m as possible (red curve on the right-handside of Fig. 19). Note that this adaptive process implicitlyforces CAV #2 to maintain the same speed as non-CAV #1,as shown by the red curve on the left-hand side of Fig. 19.

Fig. 19 The speed trajectories and the corresponding inter-vehicle dis-tance under mixed-traffic scenario.

9 Presence of Communication Delays

An important feature of the simulation framework presentedhere is the potential to model communication protocols inorder to study the effects of delays on safety when V2V orV2I communication is used. To ensure safety when CAVsemploy control algorithms such as those discussed in previ-ous sections, low packet delay/loss/error is necessary.

The following example explores the influence of com-munication delays on inter-vehicle safety. In this mixed-trafficscenario, we assume that the CAVs can only perceive the ex-istence of the preceding non-CAV through the coordinator.Hence, large communication delays may lead to possiblerear-end collision if the CAV is not able to adjust its driv-ing behavior in timely fashion. The non-CAV #1 is cruisingat its initial speed v1(t0

1 ) = 10m/s and CAV #2 enters thesame lane as #1 with a higher initial speed v2(t0

2 ) = 13m/s,t02 > t0

1 . While CAV #2 is waiting for the information fromthe coordinator, it simply cruises at its initial speed. If theinter-vehicle distance between vehicles #2 and #1, that is,s2(t), falls below a certain threshold, CAV #2 starts to adap-tively follow non-CAV #1 as in (11), that is, maintaining aminimum safe following distance with the preceding non-CAV #1 while minimizing energy consumption. In this ex-ample, we are using servers (as shown in Fig. 1) to simulatethe packet delay. By varying the service time of the server,we can easily examine the influence of communication de-lays on the implementation of control algorithms and inter-vehicle safety.

The speed trajectories v2(t) under different communi-cation delays and the corresponding inter-vehicle distances2(t) are shown in Fig. 20. When the communication de-lay is low, for instance, delay = 0.01s, CAV #2 is able tomake adjustments earlier so that the inter-vehicle distances2(t) (red curve) only marginally falls below the minimumsafe following distance δ = 10m. When the communicationdelay is high, for instance, delay = 3s, the inter-vehicle dis-tance s2(t) falls to 5.5m. This indicates that CAV #2 does notreceive the information regarding #1 until the inter-vehicledistance becomes too low and jeopardizes safety. When thecommunication delay increases to 6s, the inter-vehicle dis-tance falls below 0. This indicates that CAV #2 actually col-lides with #1 before it receives the information from the co-ordinator that can help it identify the preceding non-CAVand possible rear-end collision. Thus, by varying the servicetime of the servers, the operation of the communication pro-tocols can be properly investigated, leading to the potentialredesign of some protocols.

Fig. 20 The speed trajectories and the corresponding inter-vehicle dis-tance under different communication delays.

10 Concluding Remarks and Future Work

We have proposed a discrete-event and hybrid traffic sim-ulation framework based on which we have built a simula-tion model for Mcity that can be used for intelligent trans-portation system analysis. This model allows us to combineSimEvents, which has become a valuable tool for discrete-event and hybrid simulation, with the Mcity test facility,which encompasses various road/infrastructure configurations.The benefits of the simulation framework demonstrated inthis paper include (1) abstraction of continuous-time com-ponents based on discrete event systems, (2) a modular ar-chitecture that makes it simple and flexible to create vari-ous system configurations and perform simulations with dif-ferent objectives for algorithm testing and for performanceevaluation, (3) a hybrid model for Mcity that allows sim-ulations under different traffic scenarios, (4) the ability to

Page 14: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

14 Yue Zhang et al.

deal with events affecting the operation of a transportationsystems, (5) expandable functionality by incorporating mod-ules from other MATLAB toolboxes, and (6) scalability byadding more queues, servers, and MATLAB Discrete-EventSystems. In addition, MATLAB provides users with full ac-cess to model details and flexibility to manipulate the modelelements.

Ongoing research includes the incorporation of specificcommunication protocols (e.g., the Dedicated Short RangeCommunication (DSRC) protocol) which are being consid-ered for safe V2V communication. Furthermore, a diver-sity of non-CAV driving models is required to enable thestudy of how CAVs and non-CAVs interact in mixed-trafficscenarios. Ultimately, the framework should work for arbi-trary traffic scenarios and accommodate a variety of vehiclestypes, including conventional non-CAVs, EVs, and PHEVs,as well as bicycles and pedestrians.

References

Benekohal R, Treiterer J (1988) Carsim: Car-followingmodel for simulation of traffic in normal and stop-and-goconditions. Transportation Research Record (1194)

Bettisworth C, Burt M, Chachich A, Harrington R, Has-sol J, Kim A, Lamoureux K, LaFrance-Linden D, Mal-oney C, Perlman D, Ritter G, Sloan SM, Wallischeck E(2015) Status of the Dedicated Short-Range Communi-cations technology and applications: Report to Congress.Tech. rep.

Cameron GD, Duncan GI (1996) Paramics-parallel micro-scopic simulation of road traffic. The Journal of Super-computing 10(1):25–53

Cassandras CG, Lafortune S (2009) Introduction to DiscreteEvent Systems. Springer Science & Business Media

Clune MI, Mosterman PJ, Cassandras CG (2006) Discreteevent and hybrid system simulation with SimEvents. In:Proceedings of the 8th International Workshop on Dis-crete Event Systems, pp 386–387

Fellendorf M (1994) Vissim: A microscopic simulation toolto evaluate actuated signal control including bus prior-ity. In: 64th Institute of Transportation Engineers AnnualMeeting, Springer, pp 1–9

Ferrara A, Sacone S, Siri S (2018) Freeway Traffic Mod-elling and Control. Springer

Gilbert EG (1976) Vehicle cruise: Improved fuel economyby periodic control. Automatica 12(2):159–166

Hellstrom E, Aslund J, Nielsen L (2010) Design of an effi-cient algorithm for fuel-optimal look-ahead control. Con-trol Engineering Practice 18(11):1318–1327

Hooker J (1988) Optimal driving for single-vehicle fueleconomy. Transportation Research Part A: General22(3):183–201

Kato S, Tsugawa S, Tokuda K, Matsui T, Fujii H (2002)Vehicle control algorithms for cooperative driving withautomated vehicles and intervehicle communications.IEEE Transactions on Intelligent Transportation Systems3(3):155–161

Krajzewicz D, Hertkorn G, Rossel C, Wagner P (2002)Sumo (simulation of urban mobility)-an open-sourcetraffic simulation. In: Proceedings of the 4th Mid-dle East Symposium on Simulation and Modelling(MESM20002), pp 183–187

Lee J, Park B (2012) Development and evaluation of a co-operative vehicle intersection control algorithm under theconnected vehicles environment. IEEE Transactions onIntelligent Transportation Systems 13(1):81–90

Li SE, Peng H, Li K, Wang J (2012) Minimum fuel con-trol strategy in automated car-following scenarios. IEEETransactions on Vehicular Technology 61(3):998–1007

Li W, Mani R, Mosterman PJ (2016) Extensible discrete-event simulation framework in SimEvents. In: Proceed-ings of the 2016 Winter Simulation Conference, IEEEPress, pp 943–954

Liu A, Salvucci D (2001) Modeling and prediction of humandriver behavior. In: Intl. Conference on HCI

Macadam CC (2003) Understanding and modeling the hu-man driver. Vehicle system dynamics 40(1-3):101–134

Malikopoulos AA, Cassandras CG, Zhang Y (2018) A de-centralized energy-optimal control framework for con-nected automated vehicles at signal-free intersections.Automatica 93:244–256

MathWorks R© (2016a) MATLAB R© Object-Oriented Pro-gramming (R2016b). MathWorks R©, Natick, MA

MathWorks R© (2016b) MATLAB R©, Primer (R2016b).MathWorks R©, Natick, MA

MathWorks R© (2016c) SimEvents R©, User’s Guide(R2016b). MathWorks R©, Natick, MA

MathWorks R© (2016d) Simulink R©, User’s Guide (R2016b).MathWorks R©, Natick, MA

Meng X, Cassandras CG (2018) Optimal control of au-tonomous vehicles for non-stop signalized intersectioncrossing. In: 57th IEEE Conference on Decision and Con-trol (to appear)

Shladover SE, Desoer CA, Hedrick JK, Tomizuka M, Wal-rand J, Zhang WB, McMahon DH, Peng H, Sheik-holeslam S, McKeown N (1991) Automated vehicle con-trol developments in the path program. IEEE Transactionson Vehicular Technology 40(1):114–130

Versteegt E, Klunder G, Arem Bv (2009) Modelling cooper-ative roadside and in-vehicle intelligent transport systemsusing the its modeller. In: 12th World Congress on Intelli-gent Transport Systems 2005, 6 November 2005 through10 November 2005, San Francisco, CA, 1558-1567

Vogel K (2003) A comparison of headway and time to colli-sion as safety indicators. Accident analysis & prevention

Page 15: A Discrete-Event and Hybrid Traffic Simulation Model Based ...

A Discrete-Event and Hybrid Traffic Simulation Model Based on SimEvents for Intelligent Transportation System Analysis in Mcity 15

35(3):427–433Wiedemann R (1974) Simulation des strassenverkehrs-

flusses.Zhang Y, Cassandras CG (2018a) A decentralized optimal

control framework for connected automated vehicles aturban intersections with dynamic resequencing. In: 57thIEEE Conference on Decision and Control (to appear)

Zhang Y, Cassandras CG (2018b) The penetration effect ofconnected automated vehicles in urban traffic: an energyimpact study. In: 2nd IEEE Conference on Control Tech-nology and Applications, pp 620–625

Zhang Y, Malikopoulos AA, Cassandras CG (2016) Optimalcontrol and coordination of connected and automated ve-hicles at urban traffic intersections. In: Proceedings of the2016 American Control Conference, pp 6227–6232

Zhang Y, Cassandras CG, Li W, Mosterman PJ (2017a)A SimEvents model for hybrid traffic simulation. In:Proceedings of the 2017 Winter Simulation Conference,IEEE Press, pp 1455–1466

Zhang Y, Cassandras CG, Malikopoulos AA (2017b) Opti-mal control of connected automated vehicles at urban traf-fic intersections: A feasibility enforcement analysis. In:Proceedings of the 2017 American Control Conference,pp 3548–3553

Zhang Y, Malikopoulos AA, Cassandras CG (2017c) De-centralized optimal control for connected automated ve-hicles at intersections including left and right turns. In:56th IEEE Conference on Decision and Control, pp 4428–4433

Zhang Y, Cassandras CG, Li W, Mosterman PJ (2018) Adiscrete-event and hybrid simulation framework based onSimEvents for intelligent transportation system analysis.IFAC-PapersOnLine 51(7):323–328