49
Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Embed Size (px)

Citation preview

Page 1: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Traffic Flow SimulationCar-Following Model

By: Ittinop(Pun) Dumnernchanvanit

Page 2: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Introduction:

What is done in this project?◦Simulate traffic following each individual

car.◦Use AI to simulate driver’s behavior on road◦Observe and analyze traffic phenomena

Why car-following model?◦Traffic is extremely complex and most

phenomena are non-linear and cannot be solved easily and accurately through equations.

Page 3: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Example uses for simulation:

◦Can help maximize traffic flow. For instance, determine the most efficient automated red light, green light pattern.

◦How far to put a warning sign for road block.

◦Help in choosing between stop sign/red light green light at specific intersection

Page 4: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Phenomena Simulated:ShockwaveRoad blockCutting in frontPlatoonSystem of four way and three

way intersections

Page 5: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanisms behind the simulationSpeed

Page 6: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Density Approximation

Page 7: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanisms behind the simulationAcceleration:

Page 8: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanisms behind the simulationAngular movement calculated

using turn radius.◦This way we can turn without

worrying about speed

Page 9: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanisms behind the simulation: Angular movement

Page 10: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanism behind the simulation: Angular movementAngular movement:

Page 11: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanisms behind the simulation: Turn radiusTurn radius calculation: (for future

improvement)◦ 1. Find intersection using y = mx+b etc.◦ 2. Find distance from lane end to

intersection◦ 3. Find angle 3◦ 4. Find turn radius

Page 12: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Mechanisms behind the simulationhow to show vehicle with its

directiontake car to center, then use

rotational matrix, then take it back

Page 13: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Project code composition:

CarLaneCreatormain

Page 14: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

CarVariables:

◦(x,y) ◦Direction◦Max speed◦Max acceleration◦Max brake◦Lane◦waypoints

Page 15: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

CarMethods:

◦react() –determines acceleration and angular movement. Basically that is how real world driver control car, pedal/brake for acceleration and wheel turning for angular movement.

◦move() – move the car according to acceleration and angular movement.

◦getFrontCar(), getBackCar(), getBackMostCar()

Page 16: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

LaneVariables

◦Position◦Width◦Direction◦Leftlane, rightlane◦Start, end

Methods◦getDirection()◦ insertAdjacentLane(Lane* leftlane_raw,

Lane* rightlane_raw)◦ isEqual(Lane* a)

Page 17: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

CreatorWorks like car factory that spit out car

on to lane from some specific point.Spit out if no car with in a specific

distancestarting_speed:

◦= max_speed*(1-min_d/d);Adjust to different density

automatically and will not over produce.

Can adjust density using this.

Page 18: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

CreatorVariables:

◦Waypoints, endland transitions◦Distance between cars◦Starting speed◦Chance to produce etc.

Methods◦closeByCar() test if there is car near

by the creator object (Can adapt do different density)

◦createCar()

Page 19: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

MainSet-up the system

◦Build lanes, and creators/or carsloop through time steps

◦Run the car◦Record the results

Page 20: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Assumptions• All units in meters and seconds• chose 0.1 sec for time step because

human reaction is 0.2 secMax speed: 65 kmphMax acceleration: 3.79 m/s

◦(~7.1s 0-60mph) Minimum distance between car:

◦ 7m from center to center, or around 2-3m between car.

Page 21: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Max Flux DerivationWhat should max flux be?

Page 22: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Steady State Movie

Page 23: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Max Flux Data

Distance between cars (m)

flux (n/s)

24 1.0619 1.1814 1.27

(calc. = 1.285)9 14 0.66

Page 24: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

ShockwaveTraveling disturbance in

distribution of cars on road.Usually backward motion

Page 25: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

ShockwaveVideo:

Page 26: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

PlatoonThis is an idea to group vehicle in

to platoons to increase the capacity of road.◦This allow cars to be closer to each

other.This will need smart car that can

be driven by artificial intelligence

Page 27: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

PlatoonVideo:

Page 28: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

PlatoonData comparison: (Assume that

on one of the lane, there is 50%/50% chance that creator will produce platoon or car.)

average final time (s)

flux (n/s)

Platoon 24.1601 1.73No Platoon 27.174 1.27

Page 29: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Road Block:How it is done:

◦Car object contain pointer to object targetlane and lane

◦Why targetlane? vehicles will also check other vehicle’s

targetlane in their loop so they can recognize incoming car from another lane and yield for it.

Page 30: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Road Block:Algorithm

◦At road block, vehicle slow down and tries to cut in front of another vehicle.

◦distance to back car and to front car in target lane vehicle need to cut is set

◦when vehicle is set to change lane, it turn and run toward the lane and then turn the wheel back when it is in the middle and

Page 31: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Something to keep in mind when looking at dataTime is counted from entering

system to exiting system. If flux is low, it might means

traffic jam might propagate much longer than system which means the car would have waited much longer outside the system than the case with less flux

Page 32: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Road Block MovieNo sign, see block at around 100

Page 33: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Road Block MovieSign at 100, see actual block

around 200

Page 34: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Road Block Data:

No Warning Sign Warning SignProduction distance

average final time (s)

flux (n/s) average final time (s)

flux (n/s)

24 70.7099 0.37 51.7759 0.3634 41.8327 0.366667 28.6344 0.42666744 36.5018 0.37 23.2858 0.423333

Page 35: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Cut in Front: How it is doneDriver looks to another lane to

decide whether it is worth to cut in front.

Then look to the back to determine if it is possible to do so

Page 36: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Cut in Front: How it is done Judgment criteria driver use for front car:

◦ coefficient*( (speed of front car in our lane)*time +distance to front car in our lane ))

◦ (speed of front car target lane)*time +distance to front car in target lane

◦ where time is any set time, depending on driver’s experience.

◦ coefficient allow us to set how much we want the driver to cut

Page 37: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Cut in Front: How it is doneThen look at back car

◦driver look at speed of back car and distance to back car.

◦driver knows the amount of time he will use to cut in front.

◦simple algorithm used is just, (coefficient*distance) >( (back car speed)*(cut time))

Page 38: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Cut in Front: Movie

Show outside

Page 39: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Cut in Front: Data (5 lanes), del_t = 1.0s

Distance = 14 m Distance = 54 m

Coefficient average final time (s)

flux (n/s) Number of cuts per car

average final time (s)

flux (n/s) Number of cuts per car

1.1 48.9568 1.45 1.69195 38.8109 0.95 0.22807

1.5 48.3438 1.49 1.05593 38.7677 0.95 0.157895

2.0 46.417 1.48667 0.44843 38.7014 0.95 0.101754

3.0 45.8578 1.49333 0.176339 38.7028 0.95 0.0982456

5.0 45.7897 1.49 0.152125 38.7021 0.95 0.0982456

Page 40: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Keep in mind:Note that there are so much

more variables such as car density we can manipulate and these behaviors might change totally.

Page 41: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System:System of four lane with three

lane attached to it on the eastCases:

◦Red/green light◦all-way stop sign

Page 42: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: How it is doneWaypoints:

◦the way point build and given to car creator

◦makes sense because driver usually knows where he is going to go from the start. (most of the time)

◦In this project, the waypoints are different lanes the car will go through before exiting

Page 43: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: How it is doneRed light/Green light set up

◦Red light are built into lane class. Basically, car on the lane check if it is turned on, if so stop at the light if front car is farther than the lane end.

◦Set red light in main class. Set repeating pattern using fmod()

◦Assume no left turn

Page 44: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: Red light/Green light VideoShow outside

Page 45: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: How it is doneAll way Stop signs in this project

was extended from red light code.

Check area in the middle and open green light to let some car in temporarily.

Page 46: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: All-way Stop Signs Video

◦Show outside

Page 47: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: Data

Red light/green light Stop signsProduction Distance

average final time (s)

flux (n/s) average final time (s)

flux (n/s)

7 102.126 1.87143 110.135 0.48571415 97.4733 1.87143 104.56 0.61428630 90.122 1.81429 92.4511 0.64285750 83.9205 1.67143 74.2911 0.642857

Page 48: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

Complex Road System: Analysis

So traffic lights are better than stop signs in traffic flow at high flux.

They have around the same efficiency at low flux. This is the reason why why we see all-way stop signs in areas with less traffic.

Page 49: Traffic Flow Simulation Car-Following Model By: Ittinop(Pun) Dumnernchanvanit

The End:Thank you for Listening!