Cooperative Vehicle's On Time Discrete Simulation of Kinematic...

84
On Time Discrete Simulation of Cooperative Vehicle's Kinematic Behaviour Master Thesis, IDE 1262, June 2012 Embedded and Intelligent Systems Master thesis School of Information Science, Computer and Electrical Engineering Danqing Ni & Junwei Chen & Zao Sun

Transcript of Cooperative Vehicle's On Time Discrete Simulation of Kinematic...

Page 1: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

On Time Discrete Simulation ofCooperative Vehicle'sKinematic Behaviour

Master Thesis, IDE 1262, June 2012Embedded and Intelligent Systems

Masterthesis

SchoolofInformationScience,Com

puterand

ElectricalEngineering

Danqing Ni & Junwei Chen & Zao Sun

Page 2: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating
Page 3: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

On Time Discrete Simulation ofCooperative Vehicle’s Kinematic

Behaviour

Master’s Thesis in Embedded and Intelligent Systems

Danqin Ni Zao Sun Junwei Chen

2012/06/29

Page 4: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Preface

This master thesis is the result of six months research within the master’sprogram Embedded and Intelligent Systems at Halmstad University.

First of all, we would like to give our thanks to Prof. Tony Larson for hissupport, guidance and advice throughout the project. We would also like to thankDr. Edison Pignaton De Freitas for the valuable suggestion about the projectthrough e-mails. Meanwhile, Special thanks to Isabel Barradell from UK for theprofessional language advice on our report. Additionally, thanks to our fellowclassmates Xi Zhou and Mingkun Yang for their help in the project. Finally, wewant to show the gratitude to our families for the great opportunity and supportof living and studying.

i

Page 5: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

ii

Page 6: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Abstract

The vehicle plays an important role in peoples life in modern times. The vehi-cle’s behaviour is a complex and detailed subject, which requiring the knowledgeof mathematics and physics. Meanwhile, the vehicles’ behaviour is affected by alot of different conditions, such as the driver and the environment. For the purposeof traffic safety, simulation is required to analyze the vehicles’ behaviour. Vari-eties of behaviour models, based on different levels (Macroscopic, Mesoscopic andMicroscopic) have been presented. Vehicles are able to interact with each otherthrough the Vehicular Ad Hoc Network (VANET). It is worthwhile to simulatehow the behaviour is affected by an exchange of kinematic data.

This thesis presents a new simulator, which is designed at microscopic level,based on the graph theory. Not only different vehicles’ behaviour, but also coop-eration between vehicles can be implemented in the simulator. A new model ofcollision avoidance is created, incorporating the concept of kinematics and humanemulation. The car-following model is also performed for the formation of trafficflow. Overall, the modeling in the simulator is simplified by ignoring the networkdisturbances. The data collected from the results of the simulation is used todisplay a scenario as visualization of a vehicles behaviour

iii

Page 7: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

iv

Page 8: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Contents

1 Introduction 11.1 Investigation of the study area . . . . . . . . . . . . . . . . . . . . . 11.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2.1 Problems found in the research area . . . . . . . . . . . . . . 21.2.2 Further study of the problems . . . . . . . . . . . . . . . . . 2

1.3 Approach chosen to solve the problem . . . . . . . . . . . . . . . . 41.4 Thesis goals and expected results . . . . . . . . . . . . . . . . . . . 5

1.4.1 Goals aimed to achieve by the implementation . . . . . . . . 51.4.2 Measure and test of the implementation . . . . . . . . . . . 5

2 Background 72.1 Overview of vehicles’ behaviour . . . . . . . . . . . . . . . . . . . . 7

2.1.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.1.2 Influence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.2 Cooperative vehicle’s behaviour . . . . . . . . . . . . . . . . . . . . 82.3 Necessity for simulation . . . . . . . . . . . . . . . . . . . . . . . . 82.4 Concepts in traffic modeling . . . . . . . . . . . . . . . . . . . . . . 92.5 Reaction time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.6 Urban mobility model . . . . . . . . . . . . . . . . . . . . . . . . . 102.7 Collision avoidance behaviour . . . . . . . . . . . . . . . . . . . . . 112.8 Existing urban traffic models . . . . . . . . . . . . . . . . . . . . . . 122.9 Mobile communication assistant network . . . . . . . . . . . . . . . 15

3 Methodology 173.1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.1.1 Points and Nodes . . . . . . . . . . . . . . . . . . . . . . . . 183.1.2 Roads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.1.3 Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.2 Vehicle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.2.1 Forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.2.2 Turn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.3 Drivings behaviour . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.1 Direction threshold . . . . . . . . . . . . . . . . . . . . . . . 263.3.2 Collision avoidance . . . . . . . . . . . . . . . . . . . . . . . 273.3.3 Car-following . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.4 Drivers behaviour . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.4.1 Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.4.2 Decision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

v

Page 9: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

vi CONTENTS

3.4.3 Reaction time . . . . . . . . . . . . . . . . . . . . . . . . . . 353.5 Cooperative behaviour . . . . . . . . . . . . . . . . . . . . . . . . . 36

3.5.1 Communication establishment . . . . . . . . . . . . . . . . . 363.5.2 Transmission and reception . . . . . . . . . . . . . . . . . . 373.5.3 Decision making . . . . . . . . . . . . . . . . . . . . . . . . . 383.5.4 Package dropping . . . . . . . . . . . . . . . . . . . . . . . . 38

4 Implementation 394.1 Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.2 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.3 Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.3.1 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424.3.2 Graph and vehicle distribution . . . . . . . . . . . . . . . . . 43

4.4 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.4.1 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.4.2 Capacity and Saturation . . . . . . . . . . . . . . . . . . . . 46

5 Related work 475.1 Briefly research of the existing simulation . . . . . . . . . . . . . . . 47

5.1.1 Introduction of SUMO-GUI . . . . . . . . . . . . . . . . . . 475.1.2 Successful experiments in SUMO-GUI . . . . . . . . . . . . 485.1.3 Failed experiment: Collision avoidance behaviour simulation 495.1.4 Analyze of experiments results . . . . . . . . . . . . . . . . . 50

5.2 Comparison between SUMO-GUI and the new simulator . . . . . . 50

6 Conclusions and Future Work 536.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.2 Contribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.3 Defects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546.4 Further Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Bibliography 58

A Examples of different road model 59

B Run vehicles in Manhattan model 63

C Run vehicles in a complex model (Manhattan + Ring) 65

D Architecture of the simulator 69

Page 10: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

List of Figures

2.1 Multi-lane separation rules in urban mobility models . . . . . . . . 102.2 Collision avoidance behaviour . . . . . . . . . . . . . . . . . . . . . 112.3 A structure of common model . . . . . . . . . . . . . . . . . . . . . 122.4 Highway mobility model . . . . . . . . . . . . . . . . . . . . . . . . 132.5 Manhattan mobility model . . . . . . . . . . . . . . . . . . . . . . . 132.6 Traffic Sign model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.7 Ring Intersection model or Roundabout model . . . . . . . . . . . . 15

3.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2 Method of straight roads . . . . . . . . . . . . . . . . . . . . . . . . 193.3 Method of turning or curve roads . . . . . . . . . . . . . . . . . . . 203.4 Example of graph-based road topology . . . . . . . . . . . . . . . . 213.5 Example of cross road graph . . . . . . . . . . . . . . . . . . . . . . 213.6 A road crossing as the result of Figure 3.5 . . . . . . . . . . . . . . 223.7 Next position computation . . . . . . . . . . . . . . . . . . . . . . . 233.8 Curve segmentation when turning . . . . . . . . . . . . . . . . . . . 243.9 Vector rotation in 2D-axis . . . . . . . . . . . . . . . . . . . . . . . 253.10 Example of reverse direction perception . . . . . . . . . . . . . . . . 273.11 Lane change of gap acceptance model[17] . . . . . . . . . . . . . . . 273.12 Collision avoided by vision initiated action . . . . . . . . . . . . . . 283.13 Drive back after a collision meeting . . . . . . . . . . . . . . . . . . 293.14 Car follow with gap estimation . . . . . . . . . . . . . . . . . . . . 303.15 The space of interaction of the driver with obstacles [20] . . . . . . 313.16 Vision based on location, sight distance and rotation angle . . . . . 323.17 Decision function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.18 Flowchart of driving in model . . . . . . . . . . . . . . . . . . . . . 333.19 Decision tree of driving . . . . . . . . . . . . . . . . . . . . . . . . . 343.20 Route decision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.21 Route decision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.22 Vehicle communication in range . . . . . . . . . . . . . . . . . . . . 363.23 Architecture of transmission . . . . . . . . . . . . . . . . . . . . . . 38

4.1 Trace points output . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.2 Example of collision avoidance . . . . . . . . . . . . . . . . . . . . . 414.3 Example of car follow . . . . . . . . . . . . . . . . . . . . . . . . . . 424.4 Loop structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.5 Result of time consumption at each quantity level . . . . . . . . . . 46

5.1 Experiment in SUMO-GUI: Circle road . . . . . . . . . . . . . . . . 48

vii

Page 11: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

viii LIST OF FIGURES

5.2 Experiment in SUMO-GUI: Crossing . . . . . . . . . . . . . . . . . 485.3 Experiment in SUMO-GUI: Manhattan model . . . . . . . . . . . . 49

6.1 Accident at cross roads . . . . . . . . . . . . . . . . . . . . . . . . . 546.2 Road without fixed width . . . . . . . . . . . . . . . . . . . . . . . 54

A.1 Result of bend road . . . . . . . . . . . . . . . . . . . . . . . . . . . 60A.2 Result of cross road . . . . . . . . . . . . . . . . . . . . . . . . . . . 61A.3 Result of ring road . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

B.1 Result of running in Manhattan model . . . . . . . . . . . . . . . . 64

C.1 Prototype of Manhattan and ringroad . . . . . . . . . . . . . . . . . 65C.2 Setting nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66C.3 Result of running in mix model of Manhattan and ring . . . . . . . 67

D.1 Architecture of the simulator . . . . . . . . . . . . . . . . . . . . . . 69

Page 12: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

List of Tables

3.1 The relationship between node and edge . . . . . . . . . . . . . . . 183.2 The relationship of those vehicles in connection . . . . . . . . . . . 37

4.1 Map file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414.2 Trace file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414.3 Graph-based road model . . . . . . . . . . . . . . . . . . . . . . . . 434.4 Vehicle distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.1 Comparison between SUMO-GUI and the new simulator . . . . . . 51

A.1 Node list of bend road . . . . . . . . . . . . . . . . . . . . . . . . . 59A.2 Road list of bend road . . . . . . . . . . . . . . . . . . . . . . . . . 59A.3 Node list of cross road . . . . . . . . . . . . . . . . . . . . . . . . . 60A.4 Road list of cross road . . . . . . . . . . . . . . . . . . . . . . . . . 60A.5 Node list of ring road . . . . . . . . . . . . . . . . . . . . . . . . . . 61A.6 Road list of ring road . . . . . . . . . . . . . . . . . . . . . . . . . . 62

B.1 Node list of Manhattan model . . . . . . . . . . . . . . . . . . . . . 63B.2 Road list of Manhattan model . . . . . . . . . . . . . . . . . . . . . 63

ix

Page 13: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

x LIST OF TABLES

Page 14: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Chapter 1

Introduction

Software simulation is very helpful to the research of vehicles’ behaviour. Itcan provide a highly imitative virtual world to restore the reality. Experiment ofinnovation can be carried out in the simulator and thus the high costs of realisticreal physical testing can be avoided or reduced. For example, there are no realvehicles needed to be crashed during the accident simulation test; for vehiclescommunication, purchasing equipment to construct a realistic cooperative wirelessnetwork can be ignored temporarily. Based on this point, the research of this thesisstarted.

The research is stared from studying the existing simulation tools. There areseveral simulators which have good performance of the vehicles behaviour. Mostof them are well developed and performed based on certain traffic models andspecified physical models. SUMO-GUI is chosen to apply some experiments. Assoon as the experiments are carried out in SUMO-GUI, some defects are found.The simulator perfectly emulated the scene of driving in the multi-lane separationroads, but for no-lane separation roads, collision avoidance cannot be performed.Collision avoidance is in particular needed when the lanes have not been dividedin the road. It is a common case in rural roads. Thus, in order to make up thedefects, constructing a simulator based on new rules is suggested and proposed asa project work in the research.

In addition, with the development of wireless communication, active driverassistance systems (ADAS) is no longer a unreachable fantasy. Hence, simulationof wireless communication network assistant driving system is considered in theproject as well for realizing data exchange for cooperative safety in driving.

1.1 Investigation of the study area

The research area investigated in this study is the software simulation of vehi-cles’ behaivour. The main task of the simulation is to generate a highly imitativevirtual world in which the real world is restored. What is a highly imitative virtualworld? As it is in the real world, the simulation world should not only perform thecurrently given circumstances but also perform the possible occurrence triggeredby the currently given circumstances.

In order to carry out the simulation of vehicles’ behaviour, first of all, the mainproperties of the vehicles’ behaviour should be clarified. Vehicles’ behaviour can be

1

Page 15: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

2 CHAPTER 1. INTRODUCTION

defined as the movement of the vehicles under the influence of drivers’ behaviourand certain physical and traffic environment. As the definition suggested, thefollowing properties should be considered in the simulation:

• Vehicles and their movement;

• Drivers and their behaviour;

• Traffic and physical environment;

Additionally, testing the cooperative wireless network and interaction behaviourcaused by this network among vehicles is one of the superiority of software sim-ulation. Cooperative vehicles’ behaviour will also be considered as one of theproperties in the simulation.

After figuring out what properties should be considered in the simulation, thenext question is how to restore these properties in the simulation world. In orderto investigate this question, the research starts from carrying out experiments inthe existing simulations.

1.2 Problem statement

1.2.1 Problems found in the research area

Some research and experiments have been carried out in the existing simula-tions. After analyzing the results of all the experiments, the research problem islocated as:

First, the simulation is typically constructed based upon urban mobility mod-els. The urban traffic environment has multi-lane separation rules which restricteach lane with the reserved direction in the simulation. The simulation is builtupon the hypothesis that all the vehicles in the simulation will follow the reserveddirection of each lane. Any kind of Collision avoidance behaviour can not beperformed in the simulation.

Second, the simulation properties are all configurated and fixed in advance,these properties are obtain from observation data collected from real world. Inother words, if the vehicles’ behaviour do not happen in the real world, there will beno observation data to be obtained and no simulation. Vehicles conflicts simulationare not very convenient to be carried out because these kinds of behaviour do nothappen very often.

Third, the simulation of communication is focusing on testing the signal qualityinstead of interaction behaviour caused by communication.

1.2.2 Further study of the problems

1. If the lane limitation and reserved direction are removed, what will happento the simulation?

After removing multi-lane separation and the reserved direction, where thevehicle will be in the road no longer depends on the orientation it is driving

Page 16: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 1. INTRODUCTION 3

towards. If considering the road is a two-dimensional coordinate system andvehicles are points and direction vectors. The points can appear anywherein the two-dimensional coordinate system no matter where their directionvectors are heading to.

These new rules are more general then the multi-lane separation rules be-cause they provide the possibility to generate any kinds of traffic geographicenvironment. For example :

The rural road models can be set up because there is no lane separation.

The urban mobility models can also be set up since the vehicles can beanywhere in the road, if the operator adds appropriate restrictions to thesimulation, multi-lane separation can be formulated.

2. If there is no lane separation rules, what is a vehicle supposed to know anddo when they meet other vehicles in the traffic environment?

In certain extent, the vehicles’ behaviour can be considered as the conse-quences of the drivers’ behaviour. The question ”what is a vehicle supposedto know and do?” actually is the question ”what is a driver supposed to knowand do?” But since the drives are in the vehicles, and the drivers do notaffect directly the simulation. Added with appropriate circumstances(e.g.Reaction time), the vehicles’ behaviour can stand for the drivers’ behaviour.

There are two methods can be applied to answer the question.

Solution A, build up a highly imitative virtual world in the simulation, enterthe observation data collected from reality, execute the simulation and obtainthe results. This method is mainly implemented in the existing simulations.

Solution B, build up a highly imitative intelligent system in the virtual worldin the simulation, set up initial parameters, execute the simulation, observethe procedure(e.g. How a vehicle makes a decision to turn right instead ofleft.) and obtain the results.

If using the Solution A to answer the question, what is the vehicles supposedto know and do will be set up based on the observation data obtained fromthe reality. Once the collision avoidance behaviour happens in reality, it canbe recorded in the observation data. And then, carried out in the simulation.

This is a good method, but some extra work has to be done in advance. Forexample, collect the observation data from real traffic environment. As longas the data collected from reality is correct and reliable. The simulation willgive out satisfactory results.

However, this method also has defects. It totally relies on the observationdata, if there is no observation data, the simulation can not be carried out.For example, some simulation provides the function to test the signal qualityof communication. But it can not simulate the interaction behaviour causedby cooperative network, because the cooperative network has not been fullydeveloped and achieved in reality. In other words, there is no observationdata to provide to the simulator.

Page 17: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

4 CHAPTER 1. INTRODUCTION

If using the Solution B to answer the question, the defects of the first methodwill not be a problem. Since there is the imitative intelligent system in thevirtual world, some vehicles’ behaviour can be generated by the simulator it-self. The simulation no longer totally relies on the observation data collectedfrom reality.

Furthermore, the simulation of some extreme vehicles’ behaviour can alsobe easily achieved in the simulator using the second method. For example,the simulation of the vehicles conflicts. As it is mentioned above, there areno real vehicles needed to be crashed during the accident simulation test.Because in the simulation, the virtual vehicles will do exactly the same asin the real world.

As the motivation of the simulation described, as many circumstances aspossible should be considered. Thus, the second method is more consistentthan the first one to meet the requirement of the motivation. However, thismethod is more challenging and complicated to carry out. Especially theintelligent decision-making system is complicated to develop.

3. If all the modification mentioned above have been achieved, are there any-thing further can be done for the simulation?

As it is mentioned above, the cooperative network has not been fully devel-oped and achieved in reality. Since software simulation reduces the high costof realistic experiments. Carrying out experiments of active driving assistantsystem(ADAS) can be one of the consideration for the further study. Andthe interaction behaviour cased by ADAS can also be taken into account fortesting the performance of it.

1.3 Approach chosen to solve the problem

In conclusion of the study above, the scenario is proposed:

First, Formulate new rules that remove the multi-lane separation and reserveddirection in the simulation. In other words, remove the limitation of where thevehicles can be in the roads.

Second, Develop imitative intelligent system for the simulation which make thesimulator does not totally rely on the data input from observation of the real world.Perform Some of the vehicles’ behaviour by setting up the initial parameters andallowing the virtual vehicles to make decisions by themselves in the simulation.

Third, Simulate not only the cooperative network signal quality but also theinteraction behaviour caused by the cooperative network.

The scenario remove the multi-lane separation; reduce the dependence of thereal world observation data; make it more convenient to simulate infrequent ve-hicles’ behaviour; provide the possibility to simulate some not fully developedfunctions. A new simulation should be constructed because the methods using bythe existing simulations are conflicting with the methods proposed by the scenario.

Page 18: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 1. INTRODUCTION 5

1.4 Thesis goals and expected results

1.4.1 Goals aimed to achieve by the implementation

1. Apply the simulation under the new rules;

2. Develop imitative intelligent system for every single vehicle in the simulation;

3. Implement as many as possible traffic models and environment;

4. Simulate as much as possible vehicles’ behaviour including collision avoid-ance behaviour;

5. Perform the interactions between vehicles caused by active driving assistantsystem(ADAS);

6. Export the simulation results in dynamic graphic demonstration;

1.4.2 Measure and test of the implementation

1. Simulation evaluation

• Run the simulation as many as possible under certain import of data:

• Same initial parameters for vehicles in same traffic model;

• Different initial parameters for vehicle in same traffic model;

• Same initial parameters for vehicles in different traffic models;

• Different initial parameters for vehicles in different traffic models;

• Maintain the results from the simulation, analyze the data, comparewith the expected results.

2. Comparison with existing simulationAs it is mentioned above, the preparatory of the thesis work is done byresearch of the existing simulations. After evaluation of the new simulation,the results shall be compared with the results maintained from the existingsimulations. The comparison work should be based on the same initial dataimport.

Page 19: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

6 CHAPTER 1. INTRODUCTION

Page 20: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Chapter 2

Background

2.1 Overview of vehicles’ behaviour

2.1.1 Definition

In general, behaviour can be defined as the actions and manners made byorganisms, systems, or artificial entities in conjunction with their environmen-t including the other organisms, systems and artificial entities around and thephysical environment [1]. Specific to the vehicle’s behaviour, organisms and ar-tificial entities refer to the drivers and vehicles, actions and manners refer to thespecific traveling status of the vehicles and certain reactions towards different sit-uations, system and environment refer to the traffic system structure and physicalenvironment.

In conclusion, the vehicle’s behaviour can be defined as the movement (goingstraight forward and backwards, turning, accelerating and decelerating, parking)of the vehicle under certain conditions of environment, which refers to two parts:the physical environment (quality of the road condition, weather conditions andquality of the vehicle itself), and the traffic environment (the quantity of the othervehicles, movement of the other vehicles).

2.1.2 Influence

• Driver’s influenceVehicles are definitely artificial entities whereas drivers are actors. To someextent, vehicle’s behaviour can be considered as the consequence of the driv-er’s behaviour. In reality, intoxication and other human factors contributewholly or partly to about 93% of traffic accidents.[2] Compared with thevehicle’s behaviour, the driver’s behaviour is much more complicated anddiversified, it is influenced by a variety of different factors such as emotions,reaction rate and the health condition of the driver, driving habits, sightrange, etc.

• Reaction timeDue to the vehicle’s behaviour can be considered as the consequence of thedriver’s behaviour. The driver’s reaction time is also an important featureneeded to be represent during the simulation.

7

Page 21: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

8 CHAPTER 2. BACKGROUND

• Environmental influenceEnvironmental influence contains two parts: the environment affects boththe objective parameter of vehicles and the subjective action and reactionof vehicles. E.g. Rain makes vehicles slide and decrease visibility.

2.2 Cooperative vehicle’s behaviour

Cooperative vehicle’s behaviour is the subset of vehicle’s behaviour. A vehicleis not an independent concept; it can be affected by many other factors in thetraffic system. The vehicle’s behaviour that has interaction between each other iscooperative vehicle’s behaviour.

Wireless communication can reduce risks for collision between vehicles by theexchange of kinematic data [3]. The mobility wireless communication networkfor vehicles is a new research area of cooperative vehicle’s behaviour. Varietyof different technology has been developed to meet the requirement of mobilitynetwork. By exchanging traffic information (e.g. Location and speed ) betweenvehicles real-time or in advance, a cooperative network is formed. Furthermore,based on the cooperative network, an assistant driving system provides the driverswith current traffic information, or even an automatic driving system whereinthe vehicles automatically analyze the situation and make the decision to can becreated.

2.3 Necessity for simulation

Concerning the research of vehicle’s behaviour, there are several problem delaythe research:

• Safety concernBoth accidents and traffic jams are vehicle’s behaviour, they are over extremefor carrying out experiments.

• Vast quantity of dataUsually, in a city, the traffic system carries huge quantity of information. Itcontains a lot of vehicles, roads, people and other factors. e.g. In Manhattanmodel [4], the road model is quite simple in the general map structure, butwhen it comes to observation, the information carried by the traffic systemis different from time to time.

• Mobile network testingAs it is mentioned above, it is possible to add the mobile assistant networkto real traffic system. Carry out experiments of the performance of thisnetwork by using simulation can be a good idea.

The performance of the mobile assistant network including two parts: signalquality of the communication network; interactions between vehicles underthe network.

Page 22: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 2. BACKGROUND 9

• Cost of real world experimentsAll the reasons mentioned above cost long time and need huge financialsupport to carry out experiments in the real world. Some of them like safetyconcern also cost problem as well.

2.4 Concepts in traffic modeling

The Macroscopic model, Mesoscopic model and Microscopic model are quitegeneral concepts, which include most of the models that have been introducedinto modeling of vehicle’s and driver’s behaviour, each one of them focuses ondifferent levels of observation. It is worthwhile to mention that: macroscopic andmesoscopic traffic flow descriptions are applied to deal with the dynamic behaviourof large-scale vehicle’s systems, such as whole regions or countries [5]; microscopicmodels are usually used to represent the traffic in smaller areas, such as singlestreets or highways.

• Macroscopic modelThe Macroscopic model is known as well as the macroscopic traffic flowmodel and is a mathematical model that formulates the relationships a-mong traffic flow characteristics like density and flow mean speed of a trafficstream. Such models are conventionally arrived at, by integrating microscop-ic traffic flow models and converting the single-entity level characteristics tocomparable system level characteristics. Traffic models are usually made toemploy them in computer aided simulations [5].

• Mesoscopic modelThe Mesoscopic model, which refers to individual mobile entities, is mod-eled at an aggregate level, exploiting gas-kinetic and queuing theory resultsor macroscopic-scale metric, such as velocity/density relationships, to deter-mine the motion of vehicles [5].

• Microscopic modelThe Microscopic model, is different from the traffic flow model, each vehicle’smovement is represented in great detail, its dynamics being treated indepen-dently from those of other cars, except for those near enough to have a directimpact on the driver’s behaviour. Microscopic models are able to reproducefine-grained real-world situations, such as front-to-near car interaction, lanechanging, flows merging at ramps and intersections [5].

2.5 Reaction time

According to the definition of vehicle’s behaviour, the vehicle’s behaviour canbe defined as the movement of the vehicle under certain conditions of environment,which refers to two parts: the physical environment, and the traffic environment.To some extent, all the movement of the vehicle is the reaction towards the certainenvironment. Reaction time is the lag between the detection of a stimulus and

Page 23: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

10 CHAPTER 2. BACKGROUND

the application of the response [6]. Different from the other feathers of vehicle’sbehaviour, during the duration of reaction time, in fact, the driver loses controlof the vehicle. Though the duration of the reaction time is very short, it is quiteimportant. Especially during the analysis and simulation of car accidents, differ-ent duration of the reaction time gives different result. As it is mentioned before,simulation of the vehicle’s behaviour is a good way to analyze car accidents andsome other experiments. When it comes to simulation of the vehicle’s behaviour,the duration of the reaction time can be presented as a short ”time-break”. Duringthe ”time-break”, the vehicle’s behaviour remains the same, after the ”time-break”other influences (e.g. The driver pushes the break) on the vehicle start to appear.Traffic engineers hae long been concerned with driver response times when con-fronted with relatively unexpected road design features or emergency events thatare likely to require a rapid response [6].

2.6 Urban mobility model

Figure 2.1: Multi-lane separation rules in urban mobility models

As it is shown in Figure 2.1.The urban mobility models have multi-lane sep-aration which means the minimum unit of the map is a lane. The black arrowsstand for the reserved direction of each lane; the blue block stand for vehicles; theactive lines are the boundary of the roads; the dotted lines are the lane separationlines; majority of EU countries uses a lane width of 3.75 m which means normallythere is not enough space for two vehicles traveling side by side in one lane [2].

As a matter of fact, the multi-lane separation of urban roads is stipulated inmost of the countries’ traffic law. A vehicle traveling in a road should follow a lane.Each lane has a reserved direction. All the Vehicles traveling in a same lane haveto follow the reserved direction. Under normal circumstances, driving in a lanetowards opposite direction of the lane’s reserved direction is not allowed. Thesetraffic rules effectively reduce the traffic conflicts and guarantee the traffic orderin congested traffic situation [2]. Because normally in the same lane, when onevehicle is driving, there will not be another vehicle that is driving head-to-headtowards the former one in the same lane.

Page 24: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 2. BACKGROUND 11

2.7 Collision avoidance behaviour

As it is demonstrated, in the situation, the minimum unit of the map is a road;a vehicle can either be in the middle, or left side, or right side of the road sincethere is no-lane separation. Two vehicles drive towards each other head-to-head ina road. Since both the vehicles and the road have width, when the vehicles reacheach other’s vision range, certain decision will be made by both of the drivers, anda series of behaviour will take place to avoid the collision. The collision avoidancebehaviour occurs frequently in some roads such as rural roads which has no-laneseparation.

In some way it is more important because in the urban roads, there are plentyof traffic rules, most of the drivers will follow the rule and reduce the accident rate.But for no-lane separation roads, since there is no limitation which area shouldthe vehicle be in the road, situation can be more complicated.

Figure 2.2: Collision avoidance behaviour

Page 25: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

12 CHAPTER 2. BACKGROUND

2.8 Existing urban traffic models

Figure 2.3: A structure of common model

Figure 2.3 is a common model structure summarized from existing researchof basic vehicle’s behaviour model. In the model, the speed is assumed to beconstant, as it is only considering what kind of behaviour that can be produced.Hence, only the basic vehicle’s behaviour is represented in Figure 2.3.

Road condition is determined by road types and road status, generally roadtype can be classified as the following models.

Page 26: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 2. BACKGROUND 13

1. Highway mobility model [6]

Figure 2.4: Highway mobility model

2. Manhattan mobility model [6]

Figure 2.5: Manhattan mobility model

Page 27: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

14 CHAPTER 2. BACKGROUND

3. Traffic Sign model (TSM) [7]

Figure 2.6: Traffic Sign model

4. Stop Sign model (SSM)Similar to the traffic sign model (TSM), instead of traffic lights, there arestop signs beside the crossing to remind the drivers that there may be someother vehicles coming from the other direction of the crossing.

Page 28: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 2. BACKGROUND 15

5. Ring Intersection model or Roundabout model [9]

Figure 2.7: Ring Intersection model or Roundabout model

Road status can be classified into smooth and jam. Traffic jams may cause thevehicle to update the predefined trace, which is the reason why it is also connectedto trace. Emergency refers to the special cases such as high priority vehicles (e.g.Ambulance, Fire engine.). The other vehicles should obviously change lane orpark at the side of the road to avoid jams and assist the high priority vehiclesto progress unimpeded. Hence, priority set is also an important consideration tosimulate the vehicle’s behaviour properly.

2.9 Mobile communication assistant network

The vehicles’ behaviour is not an independent concept, as is mentioned above;varieties of other objects in the traffic system affect it. Hence, the mobile commu-nication assistant network came into being.

Vehicular Ad Hoc Networks, known as VANET, simply means a mobile net-work in which moving vehicles are used as nodes or routes and share traffic in-formation with each other [10]. It is a kind of V2V (short for vehicle to vehicle)driving assistant network, which allows vehicles to fall out of the network rangeand join in. Traffic information which refers to the traffic environment and othervehicles’ status, as mentioned above, is the primary element that affects the vehi-cles’ behaviour. Traffic safety benefits from VANET because the network coversapproximately 100 to 300 meters distance between each vehicle and this distancecan provide traffic information out of the range to the naked eye [10]. Hence, the

Page 29: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

16 CHAPTER 2. BACKGROUND

traffic system added to VANET guarantees the drivers of the vehicles will receivetraffic information in advance and reduce the safety problems caused by poor vis-ibility. Considering the vehicle’s behaviour simulation, VANET is a good methodto achieve the goal of vehicle cooperation.

Page 30: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Chapter 3

Methodology

In traffic simulation, discrete-event and continuous-time simulation, respec-tively abbreviated as DES and CTS, are the common and classical methods beingused. DES refers to a chronological sequence of events and each event occurs at aninstant in time and marks a change of state in the system [12]. CTS means thatcomputer model of a physical system that continuously tracks system responseover time, according to a set of equations typically involving differential equations[13].

The vehicles behaviour, represented as kinematic data, is recorded at each timestep in simulation. Briefly, the data implies the chronological sequence of events,which may include moving forward, turning, following, etc. The behaviour switch-es at some instant when the corresponding situation happens. The concept of thissimulation is tracking the positions of all the vehicles at each time step. Thus,DES becomes the choice to realize such a simulation. Furthermore, the function ofa timer in the simulation helps the simulator to run at a certain frequency, whichmeans the vehicles move within a time interval. Meanwhile, location informationis collected at each time step. In order to record and restore what happens in thesimulation, a trace file will be generated after each simulation. The file can thenbe used for traffic visualization and performance evaluation later.

The goal of a traffic simulation is to collect data about the traffic flow [14].In this case, the emphasis is behaviour. However, behaviour is inevitably affectedby some other traffic circumstance, instead of being only caused by the driveror the properties of the vehicle itself. Though the behaviour can be representedwith trajectory data, the road system for a vehicles movement is a prerequisite.Consequently, road model information is indispensable in the data collection of asimulation.

Hence, the adopted architecture is divided into four parts: Model, Behaviour,Simulator and Restore. This architecture is presented in the Figure 3.1.

17

Page 31: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

18 CHAPTER 3. METHODOLOGY

Edge1One Node Edge2

. . .EdgeN (N is a positive integer)

Table 3.1: The relationship between node and edge

Figure 3.1: Architecture

3.1 Model

Generally, a road model is based on Graph Theory [15] in which the whole roadnetwork topology can be sketched as nodes and edges. The graph representation ishelpful to implement some path-finding algorithms such as the Dijkstra Algorithm[16]. The relationship between node and edge is illustrated in Table 3.1.

Afterward, the edge must be widened for the vehicles movement. Finally, amap can be depicted by roads which are connected by nodes. As a road systemtopology, the node is an intersection and the edge is a road segment.

3.1.1 Points and Nodes

One of the primary elements for generating the traffic environment is the road.Point is the basic element in the coordinate system. Node, a subset of point, whichis also called as vertex, is put forward to formulate the road topology.

Page 32: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 19

The whole model is a 2-Dimensional coordinate system which makes pointsPi(x, y) the basic unit element.

M = {Pi|i = 1, 2, 3 . . . N}(M means the model 2-Dimensional coordinate sys-tem; N means size of the model).

In addition, to avoid some complicated calculations in quadrant switch, themodel is limited at first quadrant which means:

Pi = {x, y|x > 0, y > 0}

In the simulation, the Road is defined as a line segment (edge) which is deter-mined by two nodes wherefore one straight road requires two fixed nodes. In thiscase, a node is considered as an end point. Besides, since one node can connectseveral roads like a hub, the intersection can be taken as the node. Meanwhile, todescribe a curved road, firstly, curved road must be cut into many sub-segments.Each sub-segment is approximately represented as a straight line. The method isthat putting the nodes into the curved road as sampling points. Then the curvedroad becomes a series of sequential sub straight roads; finally, the curved road isgenerated in the same way as straight road.

Furthermore, the node helps to formulate vehicles routes in a traffic system. Avehicle traveling in one straight road is simulated as the vehicle moves from onenode to its neighbour node. A sequence of nodes which should be passed by canbe saved in a list to denote the itinerary. Figure 3.2 shows the procedure.

Figure 3.2: Method of straight roads

Vehicle V travels from point A0 to A6. V is at point A2. A0 and A1 have beenreleased.

From A0 to A6, vehicle V reaches sequentially, as soon as V reaches the newerone, the former one will be released. E.g. from A0 to A2, when V reaches A1,release A0. This method carries one pieces of information, the itinerary direction.Then driving direction is able to be measured by the order of the itinerary nodesand heading vector of vehicle V. According to the curved road solution mentionedabove, while the vehicle is turning, first, divide the curved road into sub-segments;second, set a sequence for each point; finally, follow the same method when trav-eling in straight roads. Figure 3.3 shows the procedure.

Page 33: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

20 CHAPTER 3. METHODOLOGY

Figure 3.3: Method of turning or curve roads

Points of B0, B1, B2, and B3 have been released since the vehicle V is alreadyon the way to B4. Vehicle V is at the position between B3 and B4. B4 is waitingfor being released after V passing by.

3.1.2 Roads

In the graph theory, the edge is connected by two arbitrary nodes. That meansa road can be formulated by a node pair. Moreover, a sequence of node pairs canindicate a complex road topology. Thus, node plays the role of either intersectionor end point in the road topology. An example of graph-based road topology isillustrated in Figure 3.4.

Those nodes only have one edge are regarded as end point whereas the inter-section node can connect more than two edges. Specially, the nodes that connecttwo edges are taken as sampling points which help to sketch the curved road.

Page 34: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 21

Figure 3.4: Example of graph-based road topology

If the road should be widened by a given value of width, it is not enough tobuild the whole map. Because one node may connect to more than one other nodeand formulate more than one edge, the bounds at the two sides of the edge arerespectively obtained from the points of bound intersections which are calculatedwith each sides nearest neighbour road side. See example of Figure 3.5.

Figure 3.5: Example of cross road graph

In Figure 3.2, there are four roads respectively marked as Road1, Road2, Road3and Road4. The points of pi1, pi2, pi3 and pi4 must be marked for better visualeffect. Otherwise, the intersection such as Node0 will be drawn as a rectangle(shown as dotted line) which should be erased.

3.1.3 Map

Lastly, through drawing the line segment which is stored as two points in theroad for each side, then the map comes out and signifies the road model has been

Page 35: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

22 CHAPTER 3. METHODOLOGY

created. See the result in Figure 3.5, which is represented in Figure 3.6 as aprototype.

Figure 3.6: A road crossing as the result of Figure 3.5

The map is sketched by MATLAB, plotting the map file exported by thesimulator. In Figure 3.6, the coordinates are exported as a file which records fourpoints per row. Obviously, those four points imply the line segment of each roadborder.

3.2 Vehicle

Some basic vehicle behaviour is fundamental to achieve the driving behaviourmentioned above. As introduced at the beginning of Chapter 3, discrete eventsimulation is adopted and a trace file is generated. It tells the concept that onekind of driving behaviour is a set of points (expressed as Formula 3.1) in whichevery two points are separated by a time step.

Ptrace = {(Xt, Yt)|0 < t ≤ n, t ∈ N, n ∈ N} (3.1)

Where n is a natural number which means how many ticks (how long) doesthe travel take and t is the time tick accumulated by time step.

In the simulation, assume the start point of a vehicle can be initialized as aknown variable and the vehicle moves at an average velocity V ; the behaviour canbe classified as the following two types.

3.2.1 Forward

When driving forward, which means the heading V̂h, a unit vector is fixed; thedisplacement can be achieved with Formula 3.2.

Page 36: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 23

∆r = V ∗∆t (3.2)

Where, ∆r means displacement, ∆t is the time interval (step).Then through Euclidean vector computation, the next position can be realized.

Figure 3.7 shows the process:

Figure 3.7: Next position computation

1.−→OS = (Sx −Ox)~x+ (Sy −Oy)~y

2.−→SN = ∆r ∗ V̂h

3.−−→ON =

−→OS +

−→SN

Where−→ON is the resolution, as O is the origin point (0, 0); thus, next position

N can be located. Because of the equation shown in Formula 3.3, evidently, thatmeans the position can be marked with N = (a, b).

−−→ON = a ∗ −→x + b ∗ −→y (3.3)

As a result, the trace data can be collected as Formula 3.4.

−−→OPi = ∆r ∗ V̂h +

−−−→OPi−1 (3.4)

Where, i means ordinal number of the trace points.

Page 37: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

24 CHAPTER 3. METHODOLOGY

3.2.2 Turn

The solution to simulate the car turning is to cut the curve into several frag-ments, via time step. The fragments are a set of line segment which can besimulated as several forward movements. It is illustrated in Figure 3.8.

Figure 3.8: Curve segmentation when turning

Thus, the concept is the same as forward. However, angular velocity must betaken into consideration because of the curve. Consequently, in our case, angularvelocity is refined as a parameter to realize the simulation of turning. If a vehiclewants to turn, within each time slot, the heading vector of the vehicle shouldrotate at a certain angle (marked in Figure 3.14) which is computed by means ofangular velocity (See Formula 3.5 [18]). After that, the vehicle just moves alongin the direction intended.

{x′ = x cos θ − y sin θy′ = x sin θ + y cos θ

(3.5)

Page 38: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 25

Figure 3.9: Vector rotation in 2D-axis

Where the vector is assumed that starts from origin point (0, 0) and ends atthe point (x, y). Then the point (x, y) is the result of rotating a certain angle θwhere origin point works as the fulcrum. It is illustrated in Figure 3.9. Herein,positive value means rotating toward anticlockwise whereas negative value meansclockwise.

Furthermore, acceleration is another physical element which cannot be neglect-ed in order to be closer to the reality. A constant value of acceleration is created tosimulate as a constant-acceleration process. Classically, integrating acceleration awith respect to time t gives the change in velocity which is simplified in Formula3.6 [19]:

v(t) = v0 +∫ t

0adt′ = v0 + at

r(t) = r0 +∫ t

0vdt′ = r0 +

∫ t

0(v0 + at′)dt′ = r0 + v0t+ 1

2at2

(3.6)

In our case, since it is defined as a discrete time interval simulation, the acceler-ation causes some influence between each two time slots. Formula 3.7 is generatedfrom Formula 3.6 and it expresses the essence in terms of mathematic inductionand considering acceleration.

v0 = 0 r0 = 0v1 = v0 + at r1 = v0t+ 1

2at2

v2 = v1 + at r2 = v1t+ 12at2

...vi = vi−1 + at ri = vi−1t+ 1

2at2

(3.7)

In this case, the acceleration is expressed as a > 0 whereas a < 0 meansdeceleration.

Page 39: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

26 CHAPTER 3. METHODOLOGY

Finally, according to Formula 3.4, if replacing the ∆r with ri, each trace pointis logged as Formula 3.8 in the acceleration model.

−−→OPi = ri ∗ V̂h +

−−−→OPi−1 (3.8)

Another important detail must be explained which is the limitation of thevelocity. It is not realistic if the speed can be increased without limits. Even ifthe situation is safe; a ceiling value (vmax) is still required to be set, which can beone of the attributes in road or in vehicle.

3.3 Drivings behaviour

Two behaviour models, Lane change Model and Acceleration Model are pro-posed in [6]. Although SUMO presents a good implementation of such kinds ofmodel, there are several roads which are just a single road without compartmental-ization, allowing bidirectional traffic flow especially in rural areas. The emphasishere is laid on this kind of road. The behaviour which may happen under suchcondition is listed as collision avoidance and car-following. In addition, directionthreshold is explained at first. It is an auxiliary tool for both of the mentionedbehaviour.

3.3.1 Direction threshold

Two behaviour models, Lane change Model and Acceleration Model are pro-posed in [17]. Although SUMO presents a good implementation of such kinds ofmodel, there are several roads which are just a single road without compartmental-ization, allowing bidirectional traffic flow especially in rural areas. The emphasishere is laid on this kind of road. The behaviour which may happen under suchcondition is listed below.

What kind of behaviour should be taken depends on the situation, especiallythe status of the car in front. Although vision helps to know that which is thenearest car in front, the driving direction is still not accessible. In such a circum-stance, a function of perceiving the direction of front car is required. Since eachcar has its own driving vector, the angle between these two vectors is referred as ahelp to realize perception. With a classical mathematic Formula, which is markedas 3.9, the value of angle can be calculated.

angle = acos−→a ∗−→b

|−→a | ∗ |−→b |

(3.9)

Then a threshold value is proposed to recognize the directions of subject carand front car. It is formulated as:

THfront =

{1 if 0 < angle < threshold value0 if threshold value<= angle < 2Pi

(3.10)

Where THfront means reverse direction with value 0 and the same directionwith value 1. In this thesis project, 90 degree(Pi/2), scilicet acute angle, is set asthe direction threshold value. Hence, if the angle is less than threshold, it can be

Page 40: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 27

expected as the same direction and vice versa. An example of reverse directionis illustrated in Figure 3.10, in which the angle is marked as θ. Until now, thedirection of front car can be watched in terms of perception and the matchedbehaviour can be determined.

Figure 3.10: Example of reverse direction perception

3.3.2 Collision avoidance

The behaviour procedure of Lane change Model [17] is shown in Figure 3.11.It tells the subject vehicle that shall merge into the other lane depends on the gapdistance, front and rear.

Figure 3.11: Lane change of gap acceptance model[17]

In a single road with one lane and bidirectional traffic, normally, drivers arefond of driving in the middle without any hindrance. When any collision happens,according to most traffic rules that driving keeps right, both of them should turnright to avoid the collision. That indicates the road is temporarily divided into twolanes by the two vehicles whose headings are reversed to each other. The procedureis shown clearly in Figure 3.12. The condition of triggering the behaviour dependson the vision and direction recognition. When the situation occurs, what canbe shot by driver is that there is a car in front. The detail about vision will bediscussed later, in the section of this thesis which deals with the driver behaviour.

Page 41: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

28 CHAPTER 3. METHODOLOGY

The trend of front car can be judged by driver. Then the decision of collisionavoidance is made. This can be formulated by direction threshold:

Figure 3.12: Collision avoided by vision initiated action

Fcollsion(t) =

{1 if THfont = 00 if THfont = 1

(3.11)

Where Fcollision(t) means the choice of doing collision avoidance or not at acertain time point t with value 1 if the direction of front car is reversed and 0otherwise.

Despite the action of avoidance, the vehicle has to be driven back to the middleline of the road. There is an instant for the driver to turn the heading back afterthe behaviour of avoidance. Then the status is restored to normal driving beforethe collision, which is illustrated as well in Figure 3.13. Time for steering back isformulated by the value of margin which is marked in the figure:

Fsteerback(t) =

{1 if Margin > 00 if Margin <= 0

(3.12)

Where Fsteerback(t) means the choice of steering back at a certain time point twith the value of 1 if margin is acceptable which is represented as greater than 0whereas 0 presents the unacceptable case.

The effect of margin value is actually for avoiding the bumping at side. Beforesteering back, both of two drivers are out of sight each other under the function ofvision. It is marked in Figure 3.13. There is an instant that one vehicle escape fromthe others vision. After that, the function of margin then can be in activation.

Page 42: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 29

Figure 3.13: Drive back after a collision meeting

3.3.3 Car-following

The car-following model was first proposed by Reuschel (1950) and Pipes(1953)and the research was extended by Kometani and Sasaki (1958) in Japan. Inthe article of “CAR FOLLOWING MODELS” [5] published by RICHARD W.ROTHERY, he summarized the efforts of what previous researchers have doneand referred how car-following model forms a bridge between microscopic andmacroscopic. In fact, the concept of traffic flow mainly comes from the behaviourof car-following. In our case, the gap distance is emphasized when building thesimulation of the following model. It is illustrated in Figure 3.14. The conditionof triggering the behaviour of car-following is essentially similar to the collisionavoidance. The only difference is the direction threshold. When the front car isin vision, a driver will do car-following if both of them are driving towards thesame direction; otherwise, do collision avoidance apparently. Hence, the logic ofthe behaviour can be formulated with direction threshold as well:

Ffollowing(t) =

{1 if THfont = 10 if THfont = 0

(3.13)

Where Ffollowing(t) means the choice of doing car-following or not at a certaintime point t with value 1 if the direction of front car is the same and 0 otherwise.

Page 43: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

30 CHAPTER 3. METHODOLOGY

Figure 3.14: Car follow with gap estimation

The other condition which affects the car-following is gap distance as mentionedabove. A long gap distance makes driver accelerate to follow the front car whereasa short distance causes deceleration for the safety. However, the exact distancevalue is controlled by the driver. For the simulation, a parameter of gap thresholdmust be assigned for each driver. Then the velocity of vehicle when driving ascar-following can be formulated:

V (t) =

Acceleration(t) if Gap > TgapV (t− 1) if Gap = TgapDeceleration(t) if Gap < Tgap

(3.14)

Where V (t) means the velocity at a certain time point t ; when gap distanceis greater than the gap threshold, do acceleration at this time point; otherwise,do deceleration; the special case is that gap distance equals to gap threshold, andthen keep the velocity of last time point.

Furthermore, from the view of a driver, a car following behaviour can be definedas a loop of two steps:

1. Observe the action of the front car and do it as well.

2. Estimate the distance to the front car and decide the action of either accel-eration, deceleration or maintain current speed.

Hence, the prediction of the front car and subsequent choices significantlyaffects the vehicle behaviour in car-following model.

3.4 Drivers behaviour

The driver, a manipulator of a vehicle, has the ability to control the vehicledirectly. The vehicles behaviour is somehow influenced by a driver. When avehicle is in travelling, the actions which are forced to take place by some specificsituations, such as a head on collision, are actually carried out by the reaction andthe decision of a driver. Both reaction and decision principally depend on what adriver has seen. Hence, to be closer to reality, vision is necessary to be simulated.

Page 44: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 31

Meanwhile, a decision tree is built to find out what kind of behaviour shall be takenafter the vision. In addition, reaction time is an important factor which shouldnot be ignored. It is a time period from seeing to acting. Although it looks likewhat happens at an instantaneous point, a lot of accidents may happen becauseof this tiny duration, especially driving in a high speed. It becomes valuable toadd the reaction time to the simulation.

3.4.1 Vision

It is proposed that the driver is considered to perceive objects within 160◦ andthe distance perceived proportional to his speed as shown in Figure 3.15. As areference, vision can be simulated as fan shaped.

Figure 3.15: The space of interaction of the driver with obstacles [20]

In order to adapt it to coordinate system, an adjustment is made for thesimulation. As is known to all, everyone has different visual abilities relating todistance. For a driver, vision is a fan shaped sight area constructed by sightdistance and head rotation angle. Therefore, sight distance and head rotationalability are dissociated as parameters to build the vision. In Figure 3.15, it issupposed that the driver keeps his sight line overlapped with the driving vector.The start edge of the fan shape comes from the clockwise rotation of the sightvector, while the end comes from anticlockwise. If a vehicle is moving, the positionis updated at every time step and that means the sight area keeps changing. Sincethe system is a discrete event simulation, it is better to simulate a vision based oncurrent position when running, instead of driving speed. In addition, the problemof how to set the sight distance and rotational angle is tough work in the field ofBiological Sciences, wherefore a fixed average value is set for each driver.

Page 45: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

32 CHAPTER 3. METHODOLOGY

Figure 3.16: Vision based on location, sight distance and rotation angle

3.4.2 Decision

What kind of decision can be made depends on the cogitation of people, whichis an arduous job related to anthropology. To simplify the concept in simulation,the decision tree is appointed to give an acceptable solution. A decision tree is adecision support tool that uses a tree-like graph or model of decisions and theirpossible consequences [12]. Based on the definition, an algorithm that simulatesthe decision making should be developed. In the simulation, a decision functionmodel which is shown in Figure 3.17 is designed to realize such a kind of tool.

Figure 3.17: Decision function

The decision model contains two parts: Route and safety.

• RouteEach vehicle has a trip route which should be set before travelling. Certainly,it is possible to change or add to the route in travelling. At least, therealways exists a destination, which can be expressed by a node and theyare must be adjacent with the last node. A node list in which the vehiclesitinerary is stored is indispensable. If the path-find algorithm is used here,

Page 46: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 33

the list can be generated instead of putting the nodes into it manually.Therefore, concerning simulation, when the vehicle reaches the destinationnode, a judgment based on the itinerary must be made among turn left,turn right and forward. As a summary, from the drivers point of view, ateach time step, the driver has the ability to know if he has arrived at thecurrent destination node or not and then do a right action on the itinerary.Meanwhile, the driver is also capable of perceiving that the journey is overor not completed by checking whether the list is empty or not.

• SafetyA vehicle can be driven only considering the route and without any trepi-dation of driving collision if the whole model only contains itself. However,it is impossible at a real-world. At least, the vehicle cannot be driven outof the road. Obviously, that is the reason why the models mentioned aboveare designed. Then it is important to make a correct decision about whatbehaviour should be taken when driving somewhere where only a turn isallowed. Moreover, turning may happen because of the route set in advance.The procedure is illustrated with the flowchart in Figure 3.18.

Figure 3.18: Flowchart of driving in model

The decision in a complex situation in which there are other vehicles moving,

Page 47: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

34 CHAPTER 3. METHODOLOGY

is mainly made by the drivers vision and perception. With the help of vision,the font vehicle can be distinguished. Then estimate the gap distance and thedifference of heading between itself and the front. Finally, make a decisionand take action. The decision tree is shown in Figure 3.19.

Figure 3.19: Decision tree of driving

For a brief and clear explanation, pseudo code is pasted below:Route:

Figure 3.20: Route decision

Page 48: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 35

Safety:

Figure 3.21: Route decision

3.4.3 Reaction time

Reaction time is duration of nerve conduction. To some extent, it is too short tobe considered. Despite the bad behaviour, traffic accident is more or less relatedwith the reaction of a driver. Some drivers may be panic when some situationappears at a high driving speed. Thus, more time will be potentially cost onreaction. Meanwhile, the action cannot be taken opportunely and that may leadto the accident. Therefore, it is important to add reaction time to the simulation.There is a definition: reaction time is the lag between the detection of a stimulusand the application of the response [17]. In the simulation, driver should bedisabled to control for a short while after a situation which needs to do someother behaviour happens; then the vehicle begins to change. A semaphore can beused to lock the control ability of driver. How long the driver is locked is solved byhow many time ticks must be go through. That can be calculated by the formulabelow:

Page 49: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

36 CHAPTER 3. METHODOLOGY

Time ticks(N) = Reaction T ime(Rt)/simulation time step(Ts) (3.15)

An extra timer counts the number of ticks if only the semaphore is validated.Once timer tick equals to N, the semaphore will be released.

In addition, there is a tricky about whats exact value can be assigned to reac-tion time. Reaction time can be flexible with different people, and it is affected bycertain situation as well. There is a conclusion said in research [11]: Differences ofup to 500 msec were found in this study. As a reference, temporarily, the reactiontime is set as a random value which is ranged from 300msec to 500msec, about 6to 10 time steps. Certainly, the value should also open as a part of interface whichcan be set at user level.

3.5 Cooperative behaviour

With the development of wireless communication, many different areas areinfluenced, even in travelling vehicles. VANET is a technology that uses mov-ing cars as nodes in a network to create a mobile network [10]. Moreover, mostmethods are using a merge of two kinds of simulation, namely traffic and net-work simulation and they are analyzed and evaluated in [2]. However, to embodythe cooperative vehicle behaviour, some simple communication methods are cre-ated wherefore those complicated network protocols are skipped. The informationwhich may contain speed, position etc. is exchanged among vehicles.

3.5.1 Communication establishment

The communication ability can be described as a range value. Speaking tothe vehicles, the communication can be established within the range which canbe drawn as a circle. From example in Figure 3.22, those vehicles in circle areconnected with the subject vehicle.

Figure 3.22: Vehicle communication in range

Page 50: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 3. METHODOLOGY 37

From the view of the whole system, each vehicle has a derivation relationshipwith the vehicles in connection. Take Figure 3.18 as an example, the situation ofcommunication can be collected as Table 3.2.

Subject The cars in connectionV2

V0 V3V4

V1 V2V2 V0

V1V3 V0

V4V4 V0

V3V5 null

Table 3.2: The relationship of those vehicles in connection

There is a precaution that vehicles are dynamic nodes in the network topologywhich requires that the communication must be refreshed at each time step.

3.5.2 Transmission and reception

Since the connection has been established, information can be exchanged. Inthe simulation, each vehicle should update its inherent package which is alwaysready to be sent at each simulation time step. The package may include its ownspeed and position or some other data are stored. The vehicle still needs to playthe role as a receiver. Before the behaviour decision is made, it has to ask for thepackage from the vehicles in connection. The communication part of the vehicleis equipped with a buffer to receive the package from others transmission. Thearchitecture is illustrated in Figure 3.23. During the transmission, a package dropmay be simulated here.

Page 51: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

38 CHAPTER 3. METHODOLOGY

Figure 3.23: Architecture of transmission

3.5.3 Decision making

A robust cooperative system can realize that no driver is needed. That meansthe decision is made by the system. However, it is not only huge but also a chaoticmission to suit for all kinds of roads. GCDC [22] makes it possible in both urbanand highway scenarios. Then back to the virtual world, in simulation, the driveritself is an illusory entity. Hence, it is demonstrated that the communication partcan take the place of some human behaviour simulation such as vision. On theother hand, it can play as an assistant system while the vision part still workstogether.

3.5.4 Package dropping

In wireless communication, the loss of package is common as well as in VANET.Moreover, vehicles are dynamic nodes in the network topology and that makes ahigher drop rate than that in a statistic wireless network environment. Normally,retransmission is the solution to the most cases that dropping happens. However,the position of a vehicle is always in changing. There is no sense to use retransmis-sion in dynamic network. In this case, it is necessary to simulate the situation thatmessage may drop when transmitting. Thus, the cooperative vehicles behaviourbased on wireless communication can be simulated closer to the reality. Throughsetting a drop rate and produce an empty package, the situation that message losscan be implemented.

Page 52: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Chapter 4

Implementation

4.1 Running

Before running the system, it is prerequisite to build a scenario. The procedureof creating can be listed as follow:

1. Set the nodes of intersection;All nodes are limited in the first quadrant and no repeated node is allowed.

2. Connect two nodes to produce a road edge;No cross roads or overlapping is allowed. Some parameters like width andmax speed can be set by manually. But they are given the default values.

3. Create the model;The model map can be produced if nodes and roads are set correctly. Somemodel examples are shown in Appendix A.

4. Create routes;The trip must be given for simulation. Route can be set as node by node.Any two continuous nodes in route must be a road. Path-finding algorithmcan be implemented to produce the route smartly.

5. Create vehicles;Some attributes of capability of the vehicle like acceleration/decelerationmust be set in advance. These influence the simulation directly. Some othervariables like the length and width of the vehicle can be reserved for furtherwork.

6. Create drivers;Line of sight and reaction time must be set for a driver. These can affectthe vision directly. Then which vehicle he owns and what route he wouldfollow are also necessary to point out.

7. Set timer;The value of time step and the time instant for stopping the simulation mustbe set. The smaller time step means the higher accuracy.

39

Page 53: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

40 CHAPTER 4. IMPLEMENTATION

After the preparatory job, the simulator can switch into running mode andoutput the trace points. In Figure 4.1, the simulation has started and in which 10drivers and vehicles are put into the model.

Figure 4.1: Trace points output

4.2 Visualization

As introduced before, map and trace files are generated. It is boring and toughto observe and thinking about the data. Therefore, Matlab is chosen to sketch themap and plot the traces. As a demand, data format must be designed so as toconvert the data into a movie for function of visualization. At least, the scenariocan be seen what happens and how the points move.

Since road can be determined by two sides and side is described by a linesegment which is constructed by two points. A method is raised that four valueswhich respectively represent the two points can be written at each row. Then everytwo rows mean a road and every column means the points value. To simplify theexplanation, the formats of map file and trace file are illustrated separately inTable 4.1 and Table 4.2.

• Map

In Table 4.1, the point values are shown with three indexes of:

(P[road][side][point]x, P[road][side][point]y)

• Trace

Page 54: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 4. IMPLEMENTATION 41

Road Side Point 1 Point 2Road1 Side1 P111x P111y P112x P112y

Side2 P121x P121y P122x P122y

Road2 Side1 P211x P211y P212x P212y

Side2 P221x P221y P222x P222y

......

......

......

RoadN Side1 Pn11x Pn11y Pn12x Pn12y

Side2 Pn21x Pn21y Pn22x Pn22y

Table 4.1: Map file format

Point1 Point2 . . . PointNVehicle1 P11x P12x . . . P1nx

P11y P12y . . . P1ny

Vehicle2 P21x P22x . . . P2nx

P21y P22y . . . P2ny

......

......

...VehicleN PM1x PM2x . . . Pnx

PM1y PM2y . . . Pny

Table 4.2: Trace file format

In Table 4.2, the point values are shown with two indexes of:

(P[vehicle][point]x, P[vehicle][point]y)

The last step is to hold the map and plot the trace points dynamically at thefrequency of the simulation time step which is set in the simulation. Herein,that behaviour mentioned before is illustrated as an example in Figure 4.2and Figure 4.3 through a series of screen shot to show the course of events.

– Collision

Figure 4.2: Example of collision avoidance

Page 55: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

42 CHAPTER 4. IMPLEMENTATION

– Follow

Figure 4.3: Example of car follow

4.3 Data Structure

4.3.1 Interface

From the view of user, those specified data which may contain graph, driver,vehicle and route is taken as input. It is required to save and convert the datato the structure that the simulator wants. In this case, the lists below are usedto load and store the data which come from user level. Thus, the lists work asinterface between the simulator and user.

• Node ListNode where the intersection, end point or sampling node is can be addedinto the node list. It is mainly for designing the road system and setting theitinerary for drivers as well. It must be ensured that two nodes have alreadyexisted in the node list when connecting two nodes as creating a road. Thesame action should be done before creating the route list.

• Road ListRoad which is built by connecting two nodes can be added into road list.On user level, any two arbitrary nodes can be connected as a road if onlythe nodes exist in the node list. In For visualization, as a recovery for thedesign of road system, road list plays an important role in creating the roadmodel. The map is drawn by the bounds of the roads; then map file can begenerated by traversing the road list.

• Route ListThose nodes which a driver wants to pass by can be added into route list.It describes the itinerary of a driver. It tells that the route list works as an

Page 56: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 4. IMPLEMENTATION 43

attributes attached under the driver. The route is presented as a sequenceof nodes. These nodes can be picked by user and randomly generated bycomputer as well. However, there is a point that must be declared. Thenodes picked must be in connection with a road. That means one nodecannot be skipped if there is no direct connection between the last node andnext node.

• Driver and vehicle ListAll the drivers who may appear in the simulation must be added into driverlist. In fact, every driver can only drive one vehicle at one time. Hence, thevehicle list appears to be not necessary; instead, it is merged into the driverlist. Obviously, driver is the most complicated object for user. Despite theproperties of a driver himself, the vehicle should be designed as well. Inaddition, the route list is also the property of the driver.

4.3.2 Graph and vehicle distribution

• GraphSince graph can be drawn with vertex and edge, and a certain vertex canobtain all the edges connecting with it, in general, vertex is set as a key anda list of edges in relation is assigned as value. Then structure of hashmapis elicited to store such kind of data and their relation. Similarly, a roadtopology is stored by setting the node as key whereas a road list is set asvalue. It is illustrated in Table 4.3 that how to save the graph-model andcreate the relation with each other.

Node Road in connectionNode1Node2Node3 Which roads can be obtained by each node?

...NodeN

Key ValueNode List< Road >

Table 4.3: Graph-based road model

Page 57: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

44 CHAPTER 4. IMPLEMENTATION

• Vehicle distributionThe other structure of hashmap is used to mark which road a certain vehiclelocates at. Table 4.4 shows how the data structure works. This kind ofstructure is helpful to reduce the time consumption and memory in simula-tion. E.g., when simulating the vision part, those vehicles which may be faraway from the subject vehicle can be abandoned. Thus, the traversing of allthe vehicles in the model is avoided wherefore a vehicle list is not necessaryto be established.

Vehicle WhereVehicle1Vehicle2Vehicle3 Which roads the vehicles locate at?

...VehicleN

Key ValueVehicle Road

Table 4.4: Vehicle distribution

In addition, this structure of vehicle distribution is dynamic whereas graphworks in a statistic way. That means vehicle distribution needs to be updatedall the time as a vehicle can turn to another road at an unknown time point.A synchronized function is provided to watch and modify the distribution.

4.4 Evaluation

4.4.1 Complexity

In the simulation, if the start point of one vehicle is occupied by some others,it will be regarded that the vehicle has not come into the model yet. It shouldwait until enough driving space is given. That means the simulator does not havethe limitation of vehicle quantity. It can run as many vehicles as wanted in anymodel. However, with the increment of vehicle numbers, the simulating durationbecomes longer and longer. The result of Figure 4.4 shows the relationship thathow long it will take at each quantity level. The vehicle numbers increase from 5to 1000 and the Manhattan mobility model[3] is chosen as the platform of roadmodel.

Page 58: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 4. IMPLEMENTATION 45

With the method of least squares, the complexity approximates linear growthexpressed as O (n). It is also drawn with a line in the Figure 4.5. For analyzingthe complexity, the loop structure of the whole project is pasted below (Figure4.4). The structure is divided into two parts. Main part is the body of the project;timer and driver threads are included. The other part is a function which helpsto find the closest vehicle in front of the subject vehicle.

Figure 4.4: Loop structure

As it is a framework project, the algorithms of human behaviour simulationare not developed and researched in detail but vision is simulated. Some fixedparameters about vehicle attributes are presented as fixed value such as acceler-ation, deceleration and etc. All of them are set before simulating. Moreover, foreach driver, only the closest front vehicle is considered. That may cause bumpingin some situation. Hence, without large size of loop computation, it causes thegrowth of linear. Though, the complexity is acceptable, the algorithm is still a de-fect of the simulator which should be improved. In fact, to be realistic, most of theparameters should be distinct to different objects. Anyway, it is a research whichinvolves not only mathematics and physics, but also anthropology and biology.

Page 59: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

46 CHAPTER 4. IMPLEMENTATION

Figure 4.5: Result of time consumption at each quantity level

4.4.2 Capacity and Saturation

The object of calculation the capacity is the map. Though it is allowed asmany vehicles as wanted, there is the saturation at each time instant. The gapdistance is determined by drivers habit when driving, but a minimum safety valuecan be assumed. Then the capacity which is shown in Formula 4.1 can be achievedwith the following assumption. Suppose:

i roads are in the map M : Rj;Minimum gap distance: D ;

Cm =

∑ik=1 Length(Rk)

D(4.1)

If vehicle length is considered, the capacity can be generated as Formula 4.2.

Cmv =

∑ik=1 Length(Rk)

Length(V ) +D(4.2)

Then if j vehicles are driving: Vj; that also means there are j drivers: Dj. Ifthe gap distance is controlled by driver instead of static value of minimum gap,then the saturation which is shown in Formula 4.3 can be achieved.

Saturation =

∑jk=1 Length(Vk) +

∑jk=1 gap(Dk)∑i

k=1 Length(Rk)(4.3)

Page 60: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Chapter 5

Related work

5.1 Briefly research of the existing simulation

5.1.1 Introduction of SUMO-GUI

Simulation of Urban MObility, known as SUMO, is an open source, highlyportable, microscopic multi-modal traffic simulation tool. SUMO mainly demon-strates how a given traffic demand which consists of a single vehicle, moves througha given road network. It is purely microscopic [11]. The Microscopic model isa very common and useful modeling concept in vehicle behaviour simulation inwhich each vehicle is modeled explicitly, has its own route and moves individual-ly. SUMO-GUI is the original SUMO with graph user interface. It is extendedwith visualization which demonstrates the vehicles’ behaviour in a more intuitivepattern compared with parameters in the command lines.

The following is the function and features of SUMO

1. Space-continuous and time-discrete vehicle movementIt is worthwhile to mention that since the calculating process of a computeris based on discrete time; all the simulations execution in the computer istime-discrete.

2. Different vehicle types, Different traffic rules, Traffic lightsThe category includes the special cases like high priority vehicles (e.g. Am-bulance, Fire engine, Police or public facilities maintain like road repairing.),rule-disturbing vehicles(e.g. Over fast vehicles, Drunk drivers).

3. Lane-separated streets with lane changingUrban streets are lane-separated streets. The Lane changing rule is repre-sented as one of the basic traffic rules of an urban traffic system. In addition,another important feature of the urban street is fixed direction for each lane.According to most of the traffic rules, normally each lane of the street onlyallows a vehicle to drive toward the reserved direction.

4. Network ExportA Wireless assistant system can be quite useful to avoid traffic jams andsome horizon-caused accidents in advance. SUMO provides the function to

47

Page 61: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

48 CHAPTER 5. RELATED WORK

generate files which contain network data. The files can be loaded into anetwork simulator such as NS2 [11].

5.1.2 Successful experiments in SUMO-GUI

Three models have been established in the SUMO-GUI. Moreover, the flowshas also been put into the road. The speed, acceleration and deceleration are setas constant value. The following figures are the demonstration of the experiments’results.

Figure 5.1: Experiment in SUMO-GUI: Circle road

In this figure, it is simulating a single vehicle traveling in a single circle roadwith single-lane separation. It is different from no-lane separation roads becauseactually it is a single lane with the reserved direction. Once the orientation isreserved, the vehicle can not head opposite to the reserved direction of the lane.

Figure 5.2: Experiment in SUMO-GUI: Crossing

Page 62: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 5. RELATED WORK 49

This figure shows the simulation of a crossing. Several more vehicles are addedin the model in order to test the traffic rules. The white lines in the middle ofeach road separated the roads into lanes. So it is a multi-lane separation model.

Figure 5.1 and Figure 5.2 are the most basic and common models in SUMO-GUI. The behaviour in the driving should be clearly comprehended. It is importantto create the basic and common road models separately for further research of acomplex road model. A complex road model can be considered as the combinationof series of simple road models. There are not so many vehicles in the demonstra-tion because the traffic flow have not been put into the models. It will be done inthe next experiment.

Figure 5.3: Experiment in SUMO-GUI: Manhattan model

This is a example of Manhattan model. As the road models has been done,the traffic flow has been put into the model. Thus, the traffic can be simulated.Meanwhile, the vehicles or driver behaviors can also be observed. Due to thedriving behaviors can be represented as some parameters such as reaction time,safe distance etc. It is obviously and certainly that different values would cause alarge influence on the whole traffic condition.

5.1.3 Failed experiment: Collision avoidance behavioursimulation

As it is mentioned above, the motivation of the simulation is to generate avirtual simulation world in which the real world is restored. In order to makethe simulation correct and reliable, it is extremely important to consider as manycircumstances as possible may occur in the real world. More experiments un-der different circumstances have been carried out in SUMO-GUI. Unfortunately,some of the experiments have failed. Some experiments aimed to perform colli-sion avoidance behaviour in the simulation, however, some unexpected situationoccurred.

In the simulator, two or more vehicles can not be put in the same lane drivingtowards different direction in one road; when two vehicles are set to drive towardsdifferent directions, they have to be put in different lanes; if the operator forces

Page 63: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

50 CHAPTER 5. RELATED WORK

to apply two vehicles in the same lane driving head-to-head, the simulation willnot start and gives out error report.

5.1.4 Analyze of experiments results

SUMO is a well-developed and widely used traffic simulation software; it isdeveloped based on urban mobility models which are typically used by most ofthe existing simulation; it is claimed to be purely microscopic which means eachvehicle is modeled explicitly and can be observed individually; SUMO-GUI pro-vides the graph user interface and result graph demonstration which demonstratesthe vehicles’ behaivour in a more intuitive pattern compared with parameters inthe command lines. In other words, the abstract date is converted into concretegraph which restores the real world traffic scan visually.

The results of the successful experiments provide useful information about thesimulation the vehicles’ behaviour:

Each vehicle shall be simulated individually for observation of its behaviour;physical models should be defined in order to represent different vehicles’ be-haviour; drivers’ behaviour and physical environment simulation are not takeninto consideration; the simulation properties are all configurated and fixed in ad-vance; the traffic environment is generated based on urban mobility models withtraffic lights and traffic rules; the test of the communication signal quality is alsoprovided, but the interaction behaviour caused by communication network amongvehicles are not simulated.

After analyzing the failed experiments results and comparing the results withother successful experiments, some problems are found.

First, the simulation is typically constructed based upon urban mobility mod-els.

Second, the urban traffic environment has multi-lane separation rules whichrestrict each lane with the reserved direction in the simulation.

Third, the simulation is built upon the hypothesis that all the vehicles in thesimulation will follow the reserved direction of each lane.

Therefore, as soon as a vehicle is generated in the simulation, it will head toan orientation which is decided by which lane it is put in. Two or more vehi-cles traveling in the same lane can never drive head-to-head towards each otherbecause they can only head to the same direction. Since the simulation proper-ties are configurated and fixed in advance, unless the properties are consideredto be correct by the simulator, the simulation will not start. Thus, the collisionavoidance behaviour can not be performed in the simulation.

5.2 Comparison between SUMO-GUI and the

new simulator

The following table shows the characterization of SUMO-GUI and the newsimulator. The main differences are between the Behaviour emphasis trait partand the Communication part.

Instead of multi-lane separation rules, the new simulator is built based onno-lane separation rules. The version range, decision-making system and reaction

Page 64: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 5. RELATED WORK 51

time are implemented to develop the imitative intelligent system in the simulation.The imitative intelligent system guarantees that some of the vehicles’ behaviour isdecided by themselves during the simulation. In SUMO-GUI, the simulation prop-erties are set in advance. They parameters of the properties are from observationdata collected in real world.

SUMO-GUI provides the function to test the quality of the wireless communi-cation. The new simulator is mainly focusing on the interaction caused by wirelesscommunication

Characterization SUMO-GUI New simulatorSimulation layer Microscopic layer Microscopic layerPhysical model Traffic flow behaviour

simulationIndividual particlemotion simulation

Vehicles’ behaviourmodeling based onfluid dynamics

Vehicles’ behaviourmodeling based onkinematics theory

Behaviour emphasis trait Multi-lane separation& Lane changing mod-el

No-lane separation &Car-following

Traffic lights & Trafficcongestion

Vision range system &Decision-making Sys-tem & Reaction time

Output Command line resultoutput & Graph us-er interface & Re-sult graphic demon-stration

Command line resultoutput & Resultgraphic demonstra-tion

Communication Network export & Fo-cus on communicationquality of mobile net-work

Driving effects of co-operative communica-tion network

Table 5.1: Comparison between SUMO-GUI and the new simulator

Page 65: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

52 CHAPTER 5. RELATED WORK

Page 66: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Chapter 6

Conclusions and Future Work

6.1 Summary

In this thesis, a simulator is designed to run simulation and output file. Inthe simulation, vehicles move at each time step. The map is generated from amethod of widening edge which is based on graph theory. The vehicles behaviouris represented as a series of position data which is logged in trace file. The driversbehaviour is implemented and its influence which mainly comes from vision anddecision. The behaviour model of collision avoidance and car-following in the roadwithout lane separation are realized in the simulation. Furthermore, data exchangeamong vehicles is implemented to obtain the effect of cooperation. Finally, thevehicles movement can be restored through plotting the data in trace file. Thetrajectory indicates the behaviour of all the vehicles. That helps to make thevehicles behaviour visible.

6.2 Contribution

The feature of traffic simulator can be summarized as what concept is focusedon and which level is located at. In this thesis project, the emphasis is laid onindividual driving at microscopic level. This simulator can help to do the researchin some aspects listed below.

• DriverAs a kind of human behaviour emulation, a driver is refined into some param-eters like LOS (Line Of Sight). Those parameters are valuable to researchdriving habit and psychology which may be helpful to reduce accident rate.

• VehicleIn the simulator, the concept is focused on individual driving. Traffic flowuses the model of fluid dynamic whereas the model of particle motion isadopted to the individual driving. The motion of a vehicle can be representedby this simulator.

• CooperationWireless communication helps to guarantee driving safety and traffic smooth.

53

Page 67: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

54 CHAPTER 6. CONCLUSIONS AND FUTURE WORK

The simulator skips the network protocol; instead, the method is implement-ed to show how the data exchange in a communication range and its effectamong the vehicles. The simulator can be a tool to find a good solution forcooperative behaviour.

• TrafficThe behaviour proposed in this thesis is necessary though it is not com-mon in urban road. This kind of simulation produces the traffic flow withcollision-avoidance and car-following. Despite that, it also presents the sit-uation that the collision happens at the intersection which is illustrated inFigure 6.1. The figure shows the crash when two cars are moving forward.Some other accidents can also happen at the same position; e.g. one caris turning and the other is moving forward with high speed. Hence, thosetraffic situations without infrastructure like traffic lights can be simulated.In addition, through setting some parameters with an abnormal value toproduce a bad driving behaviour, the accidents above may happen.

Figure 6.1: Accident at cross roads

6.3 Defects

Though the simulator can build a lot of road types, it is trouble to create thosenon-linear roads, e.g. ring road illustrated in Appendix A. The accuracy of suchkinds of road depends on the numbers of sampling points. Moreover, the width ofsome roads is not a fixed value. That means the two side lines of the road are notparallel, like what is shown in Figure 6.2.

Figure 6.2: Road without fixed width

Despite the missing points in map model construction, a real-time visual sys-tem is not provided. When running the simulation, those map and trace data

Page 68: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

CHAPTER 6. CONCLUSIONS AND FUTURE WORK 55

cannot be drawn out in a panel synchronously. In addition, some parameters arecurrently used as fixed value. However, every driver even every vehicle actuallyowns different properties like eyesight. Above all, the environment cannot set any-thing like building which may interfere the ability of vision and communication.

6.4 Further Study

As introduced at the beginning, this is a framework for simulating the cooper-ative vehicle behaviour. From the respect of road, lanes and traffic lights can beadded to make the simulation adapted into urban situation even highway. Besides,the simulation of vehicle behaviour is the key point to be reinforced. Some ideasbased on what has been done are listed as options for future work:

• Combination with existing behaviour modelMore attributes of road can be extended just like number of lanes. Thenthe map can handle the road with lane separation as well. The importanceis that the simulator has the ability to draw not only single road but alsolanes. Hence, the existing behaviour model can be added to the simulator.

• Algorithm of human decision if vehicles in visionThe approach proposed in Methodology part is that make decision onlyaccording to the closest front vehicle. However, it is far to get a right decisionthrough observing the replay. Particularly, when driving at intersection, allthe vehicles in sight should be predicted to keep safety. Therefore, differentscenario and situation need to be discussed.

• Human emulationVision has a great influence on forming vehicle behaviour. How to simulatea good vision is worth to be studied. Actually, there are some other fac-tors which are also valuable, e.g. reaction time, fatigue condition, drivingduration etc.

• CommunicationCooperative, concerned with communication, some protocols of Ad-hoc whichhas been proposed can be implemented in the simulation instead of simpletransmission mentioned in Methodology. On the other hand, although somebasic data like speed and location can be exchanged among the vehicles inconnection, more information such as vehicle type (ambulance, fire engineand etc.) can be excavated to ensure good behaviour.

• EnvironmentThe symbol of environment is weather. If driving in the frog, the vision ofa driver can be interfered. If driving in the rain, the braking capability maydecrease. It is valuable to do such a research that how environment affectsthe vehicle behaviour.

Page 69: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

56 CHAPTER 6. CONCLUSIONS AND FUTURE WORK

Page 70: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Bibliography

[1] Mood and Gut Feelings, Paul Forsythe, Nobuyuki Sudo, Timothy Dinan,Valerie H. Taylor, John Bienenstock.

[2] Safety Effects of Road Design Standards in Europe, Fred C.M, Wegman,SWOV institute for Road Safety Research, Marinus Slop, SWOV institutefor ROad Safety Research.

[3] On the requirements on models and Simulator design for integrated, VANETSimulation, Aamir Hassan, Tony Larsson Halmstad University, Departmentof Computer and Electrical engineering.

[4] Harry Lum & Jerry A.Reagen Interactive Highway Safety Design Model: Ac-cident Predictive Module. Public Roads Magazine.

[5] Vehicular Mobility Models, Marco Fiore Department of Electronics, Polytech-nic institute of Torino.

[6] Reaction time of drivers to road stimuli,Thomas J. Triggs Walter G. Harris.

[7] Integrated Mobility Model (IMM) for VANETs Simulation and Its Impact,Muhammad Alam, Muhammad Sher, Department of Computer Science In-ternational Islamic University, Syed Afaq Husain, Department of ComputerScience and Engineering Air University.

[8] Distributed Traffic Signal Control with Swarm-Self Organizing Map, JawaBarat, University of Indonesia, Prof. Dr. Toshio Fukuda from Nagoya Uni-versity.

[9] Traffic Analysis Toolbox Volume IV: Guidelines for Applying CORSIM Mi-crosimulation Modeling Software, US deportment of Transportation, FederalHighway Administration.

[10] F. Bai, N. Sadagopan, and A. Helmy, The IMPORTANT framework for an-alyzing the Impact of Mobility on Performance Of RouTing protocols forAdhoc NeTworks, Elsevier Ad Hoc Networks vol. 1 (2003), pp. 383-403, 2003.

[11] SUMO - Simulation of Urban MObility - User Documentation, Daniel Kra-jzewicz Michael Behrisch.

[12] Zeigler, B. P., Praehofer, H., & Kim, T. G. (2000). Theory of modeling andsimulation: Integrating discrete event and continuous complex dynamic sys-tems. San Diego: Academic Press.

57

Page 71: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

58 BIBLIOGRAPHY

[13] Continuous Simulation description from University of Utrecht, StewartRobinson (2004). Simulation - The practice of model development and use.Wiley.

[14] Traffic Simulation: A Case Study for Teaching Object Oriented Design. VieraK. Proulx, Northeastern University College of Computer Science, Boston, MA02115, USA.

[15] Schaums outlines of Discrete Mathematics, Third Edition. Seymour Lipschutz& Marc Lipson.

[16] Dijkstra, E. W. (1959). ”A note on two problems in connexion with graphs”.Numerische Mathematik 1: 269C271. doi:10.1007/BF01386390.

[17] Integrated Driving Behaviour Modeling by Tomer Toledo, MAS-SACHUSETTS INSTITUTE OF TECHNOLOGY, February 2003.

[18] Rotation matrix in two dimensions; URL:http://cgafaq.info/wiki/2D Point Rotation.

[19] Kinematic Equations and Problem-Solving; URL:http://www.physicsclassroom.com/class/1dkin/u1l6a.cfm

[20] POWER WHEELCHA IR DRIVER BEHAVIOUR MODELLING. HamedEmami, Yskandar Hamam 2,3, Eric Monacelli 1 and Karim Djouani2,4. LISV,University of Versailles Saint Quentin en Yvelines, Velizy, France.

[21] Decision tree; URL: http://www.mindtools.com/dectree.html

[22] Grand Cooperative Driving Challenge; URL: http://www.gcdc.net/

Page 72: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Appendix A

Examples of different road model

1. Bend Road

Node Name X YN1 25 10N2 50 55N3 125 75N4 195 75N5 265 55N6 340 10

Table A.1: Node list of bend road

Road Name Node1 Node2R12 N1 N2R23 N2 N3R34 N3 N4R45 N4 N5R56 N5 N6

Table A.2: Road list of bend road

Result:

59

Page 73: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

60 APPENDIX A. EXAMPLES OF DIFFERENT ROAD MODEL

Figure A.1: Result of bend road

2. Cross Road

Node Name X YnLeft 25 100nTop 100 175nRight 175 100nBottom 100 25nCenter 100 100

Table A.3: Node list of cross road

Road Name Node1 Node2rLeft nCenter nLeftrTop nCenter nToprRight nCenter nRightrBottom nCenter nBottom

Table A.4: Road list of cross road

Page 74: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

APPENDIX A. EXAMPLES OF DIFFERENT ROAD MODEL 61

Figure A.2: Result of cross road

3. Ring Road

Node Name X YN1 130 175N2 96 164N3 72 137N4 66 105N5 80 70N6 105 50N7 130 45N8 154 49N9 178 70N10 192 105N11 186 137N12 161 164

Table A.5: Node list of ring road

Page 75: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

62 APPENDIX A. EXAMPLES OF DIFFERENT ROAD MODEL

Road Name Node1 Node2R1 N1 N2R2 N2 N3R3 N3 N4R4 N4 N5R5 N5 N6R6 N6 N7R7 N7 N8R8 N8 N9R9 N9 N10R10 N10 N11R11 N11 N12R12 N12 N1

Table A.6: Road list of ring road

Figure A.3: Result of ring road

Page 76: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Appendix B

Run vehicles in Manhattan model

Node Name X YnLeft 25 100nTop 100 175nRight 175 100nBottom 100 25nCenter 100 100nLeftTop 25 175nLeftBot 25 25nRightTop 175 175nRightBot 175 25

Table B.1: Node list of Manhattan model

Road Name Node1 Node2rLeft nCenter nLeftrTop nCenter nToprRight nCenter nRightrBottom nCenter nBottomrLeftTop1 nLeftTop nToprLeftTop2 nLeft nLeftToprLeftBot1 nLeft nLeftBotrLeftBot2 nLeftBot nBottomrRightTop1 nTop nRightToprRightTop2 nRightTop nRightrRightBot1 nRight nRightBotrRightBot2 nBottom nRightBot

Table B.2: Road list of Manhattan model

Set 10 vehicles in the model and then make routes randomly. A series of screenshots are pasted in Figure A.4.

63

Page 77: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

64 APPENDIX B. RUN VEHICLES IN MANHATTAN MODEL

Figure B.1: Result of running in Manhattan model

Page 78: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Appendix C

Run vehicles in a complex model(Manhattan + Ring)

The prototype of graph template:

Figure C.1: Prototype of Manhattan and ringroad

Set nodes and connect roads:

The nodes are marked as red points in Figure C.2.

65

Page 79: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

66APPENDIX C. RUN VEHICLES IN A COMPLEX MODEL (MANHATTAN

+ RING)

Figure C.2: Setting nodes

Run simulation randomly:

Set 20 vehicles in the model and then make routes randomly. A series of screenshots are pasted in Figure C.3

Page 80: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

APPENDIX C. RUN VEHICLES IN A COMPLEX MODEL (MANHATTAN+ RING) 67

Figure C.3: Result of running in mix model of Manhattan and ring

Page 81: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

68APPENDIX C. RUN VEHICLES IN A COMPLEX MODEL (MANHATTAN

+ RING)

Page 82: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Appendix D

Architecture of the simulator

Figure D.1: Architecture of the simulator

69

Page 83: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

Presentation of the authors

Danqing NiDanqing Ni is from Shanghai, China. He has achieved one Bachelor degree fromShanghai Institute of Technology and the other one from Halmstad University asan exchange student. The bachelor thesis is a music player on GBA simulator,programmed by C/C++. Currently, he is pursuing the master degree of Embed-ded and Intelligent System with this thesis. As a computer science student for6 years, he has a good command of JAVA and C/C++ programming. Despitethe knowledge of embedded system, he is interested in Database modeling andC#/.NET programming.

Zao SunZao Sun is from Ningbo, China. He received Bachelor degree of Mechanical Engi-neering and Automation from Ningbo University in 2009. After one year of workin the Chinese Customs, he decided to continue studying in the program of Em-bedded and Intelligent System in Halmstad University. Currently, he is studyingin Halmstad University for some further education and improvement of program-ming languages.

Junwei ChenJunwei Chen is from Shanghai, China. He get Bachelor degree of Computer Sci-ence and Technology from Shanghai Institute of Technology in 2010. Then he wasadmitted to Halmstad University and major in Embedded and Intelligent System.Currently, he has return to Shanghai for working in an information system com-pany.

Page 84: Cooperative Vehicle's On Time Discrete Simulation of Kinematic …hh.diva-portal.org/smash/get/diva2:606234/FULLTEXT01.pdf · 2013. 2. 18. · collision avoidance is created, incorporating

APPENDIX D. ARCHITECTURE OF THE SIMULATOR 71