Front Assist Cars benefits on traffic accordions

Front Assist Cars benefits on traffic accordions preview image

1 collaborator

Face_co_(7) Philippe BALMAS (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.0 • Viewed 62 times • Downloaded 4 times • Run 0 times
Download the 'Front Assist Cars benefits on traffic accordions' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

Every Day at 3pm, on the French national highway N171, an exceptional convoy starts from Nantes, towards Saint Nazaire, situated 50 km ahead. This convoy carries a preassembled A320 floor to be integrated in a pre-final assembly line at Airbus Saint Nazaire factory. This convoy takes the total width of the road, and can only drive at 50 km/h, where the normal speed limit of the N171 is 110 km/h. And every day at 3pm, the traffic is like an accordion up to Saint Nazaire: the cars behind the exceptional convoy brake to full stop, and then start again up to 110 km/h, until they are obliged to stop again, causing every time potential car crashes. Sometimes, the traffic ends up stabilizing at steady speed of 50 km/h before arriving to Saint Nazaire.

This model models the movement of cars on this N171, and tries to see what are the parameters that improve or worsens this traffic problem, and tries to answer the question: Would self-driving cars (or at least cars with front-assist option) avoid this traffic problem ? and if yes, with what minimum proportion of self driving cars among the "manual cars" ?

Each "Manual" car is blue and follows a simple set of rules.

Each car with "Front-assist" is green and follows a set of more elaborated rules.

The model demonstrates how traffic jams can form or disappear, and tries to understand the influence of the option "front-assist" in modern cars .

HOW TO USE IT

Use the Sliders to set total number of cars and the proportion of "front-assist" cars. Click on the SETUP button to set up the map and cars.

Click on GO to start the cars moving. Note that they wrap around the world as they move, so the road is like a continuous loop, going one lane down at each loop and wrapping from bottom - right corner to up-left corner

For a "Manual" car:

The acceleration and decelaration SLIDERS control the way it slows down (decelerates) when it sees a car in the patch ahead, and the way speeds up (accelerates) when it doesn't see a car in the patch ahead.

A "Front-assist" car:

  • detects the first car ahead in a range adjusable with the SLIDER "front-assist-range"
  • then slows down progressively until it reaches the "safety-distance" adjustable with the SLIDER "safety-distance". During this slowing down , the speed is a linear function of difference between the speed and the speed of the car ahead, ponderated by the distance between the car and the car ahead minus safety-distance. This slow-down can be moderated by a coefficient with the *SLIDER "decelration coef" *(increasing the coefficient make the cars speed decrease slower)
  • if distance is below safety-distance, then the car slows down below the speed of the car ahead, using a deceleration factor adjustable with the SLIDER "front-assist-deceleration"

THINGS TO NOTICE

Initialization

The watch highlight is set on the "orange" car, wich is a "Front-assist" cars, so that its speed isn't sploiled by the "bad" behaviour that could have a "Manual" cars. Its speed must only show the state of the traffic at the back end of a flow of cars behind the special convoy. Thus, this orange car is set to be among the first cars ahead of the special convoy, which is equivalent to being the last car of the flow of cars behind the special convoy, as the world wraps up on itself.

The randomness comes with the random position of the cars at initialization, and with their random initial speed. However, I considered that the speed of the cars on a high way with no obstacles is usually quite steady and closed to the speed limit. So the initial speed is set randomly between 0.7 and 1 (the speed limit), instead of being set between 0 and 1.

"Even though all of the cars are moving forward, the traffic jams tend to move backwards. This behavior is common in wave phenomena: the behavior of the group is often very different from the behavior of the individuals that make up the group." (See Trafic Basic)

As opposed to Traffic Basic, I "expanded" the world here, drawing 13 lanes wrapping one on another, to have more distance between the special-convoy and the last car, and see long distance effects;

Plot

The plot shows three values as the model runs:

  • the fastest speed of any car (this doesn't exceed the speed limit!)

  • the slowest speed of any car

  • the speed of the last car (or almost) : the orange car

Notice not only the maximum and minimum, but also the variability -- the "jerkiness" of one vehicle.

The goal is to find conditions where the "jerkiness" of the last car's speed is dampened after a while and every cars are driving at the same speed: the speed of the special convey.

Even though both ACCELERATION and DECELERATION are very small, the cars can achieve high speeds as these values are added or subtracted at each tick and the jerkiness of the last car is ver difficult to avoid.

THINGS TO TRY

First set the proportion of "front-assist" cars to 100% and find the best parameters of these cars to have a constant flow as fast as possible. (sliders of the group "front-assist" cars)

Then try the opposite: set the proportion of "front-assist" cars to 0 % and see if it is possible to get a regular flow.

Now can try to set the proportion to 95%.

EXTENDING THE MODEL

The fact is here that the "manual" cars are set to be like "really bad" drivers. one could try to improve their "anticipation" range...

I think that the benefits of the anticipation that "front-assist" cars can have in real life isn't efficiently reproduced here , probably because the slowing down rule needs to be enhanced !

And the "dampening" effect of these "front-assist" cars could greater.

NETLOGO FEATURES

The plot shows both global values and the value for the last car in the queue, which helps one watch overall patterns and individual behavior at the same time.

The watch command is used to make it easier to focus on the orange car.

RELATED MODELS

I have used parts of code from the 2 models below and I thank them for these very helpful examples:

I used the NetLogo software:

*Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

COPYRIGHT AND LICENSE

This model was built by Philippe BALMAS for the student assignment following the lecture of Professor Georgy Bobashev , given to the A20-Cohort of DSTI on April 2021. Thank you for quoting it if re-used.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  sample-car     ;focus on a car
  special-convoy ; sepcial convoy
  car-ahead     ; one of the cars on the patches ahead each car (depending if the car is closed to the world boundary, since we are wrapping to the lane below)
  cars-ahead    ; all the cars on the "front-assist-range" patches ahead
]

turtles-own [
  speed
  speed-limit
  speed-min

]

to setup
  clear-all
  ask patches [ setup-road ]
  setup-cars
  watch sample-car
  reset-ticks
end 

to setup-road ;; patch procedure
  ifelse (pycor mod 4 < 2) [ set pcolor white ] [ set pcolor green - random-float 0.5]
end 

to setup-cars
  if number-of-cars > world-width * 12 [
    user-message (word
      "There are too many cars for the amount of road. "
      "Please decrease the NUMBER-OF-CARS slider to below "
      (world-width + 1) " and press the SETUP button again. "
      "The setup has stopped.")
    stop
  ]

  ;set the special-convoy
  create-turtles 1 [
    set special-convoy one-of turtles
    set color red
    set shape "convey"
    set size 3
    set xcor 0
    set ycor 0
    set heading 90
    ;; set initial speed to be speed-limit-convoy
    set speed speed-limit-convoy
  ]
  set-default-shape turtles "car"
  ;creates the sample car to focus on, just ahead the special-convoy (or at least among the randomly created turtles just ahead the special convoy)
  ;(equivalent of placing it as last car behind the special convoy and the  cars
  create-turtles 1 [

    set color orange
    set sample-car one-of turtles with [color = orange]
    set xcor 4
    set ycor 0
    set heading 90
    ;; set initial speed to be in range 0.7 to 1.0
    set speed 0.7 + random-float 0.3
    set speed-limit 1
    set speed-min 0
  ]
  ;creates the "manual" cars
  create-turtles (1 - front-assist-cars-percentage / 100) * number-of-cars [
    set color blue
    set xcor random-xcor
    set ycor (random  13) * 4 - 24
    set heading 90
    ;; set initial speed to be in range 0.7 to 1.0
    set speed 0.7 + random-float 0.3
    set speed-limit 1
    set speed-min 0

   ]
  ;creates the cars with front assist option or autonomous cars
  create-turtles front-assist-cars-percentage * number-of-cars / 100 [
    set color green
    set xcor random-xcor
    set ycor (random  13) * 4 - 24
    set heading 90
    ;; set initial speed to be in range 0.7 to 1.0
    set speed 0.7 + random-float 0.3
    set speed-limit 1
    set speed-min 0
    separate-cars
  ]
end 

; this procedure is needed so when we click "Setup" we
; don't end up with any two cars on the same patch

to separate-cars ;; turtle procedure
  if any? other turtles-here [
    fd 1
    separate-cars
  ]
end 

to go
  ;; if there is a car ahead of you, adapt your speed (in a way depending on wether you are a car with "front assist" or a "manual" car:
  ask turtles [
    detect-car-ahead
    ifelse car-ahead != nobody
                     [ slow-down-car ]
                     [ speed-up-car ] ;; otherwise, speed up
               ;; don't slow down below speed minimum
   if speed < speed-min [ set speed speed-min ]
               ;; or don't speed up beyond speed limit
   ifelse color != red [if speed > speed-limit [ set speed speed-limit ]]
                ;special cas for special convoy that has a lower speed limit:
                       [if speed > speed-limit-convoy [ set speed speed-limit-convoy]]   ; The convoy has a lower speed limit

   ifelse xcor + speed > 25.5 [ifelse ycor < -20 [set ycor 24
                              set xcor xcor + speed ]
                              [set ycor ycor - 4
                               set xcor xcor + speed ]]
    [fd speed]
      ]


  tick
end 

to detect-car-ahead
  ; if you are a car with "front-assist", you detect precisely the speed of the car ahead in a distance of "front-assist-range" :
  ifelse color = green or color = orange
            [;as we wrap from right to left with the lane below, and from bottom-right to top-left, we must look into the patches ahead :
              ifelse xcor + front-assist-range > 25 [ifelse ycor >= -20 [set cars-ahead other turtles-on patches with
                                                                                     [(pycor = ([ycor] of myself - 4 ) and pxcor >= -25 and pxcor < ([xcor] of myself - 51 + front-assist-range))
                                                                                           or (pycor = ( [ycor] of myself ) and pxcor >= [xcor] of myself and pxcor <= 25 )]]
                                                                          [set cars-ahead other turtles-on patches with
                                                                                     [(pycor = 24 and pxcor >= -25 and pxcor < ([xcor] of myself - 51 + front-assist-range))
                                                                                           or (pycor = ([ycor] of myself ) and pxcor > [xcor] of myself and pxcor <= 25 )]]]
                                 [set cars-ahead other turtles in-cone (front-assist-range) 180 with [ y-distance <= 1 ]]
              set car-ahead min-one-of cars-ahead [ x-distance ]]
    ; if you are a "manual" car , you detect the car ahead in the patch in front of you:
           [;as we wrap from right to left with the lane below, and from bottom-right to top-left:
            ifelse xcor > 24.5 [ifelse ycor >= -20 [set car-ahead one-of turtles-on patch -25 (ycor - 4)]
                                                   [set car-ahead one-of turtles-on patch -25 24] ]
                               [set car-ahead one-of turtles-on patch-ahead 1]]
end 

to slow-down-car ;[ car-ahead ] ;; turtle procedure
  ifelse color = green or color = orange
                  [; if you are a car with front-assist : progressive slow down while getting closer to the car ahead of you and then adapt to the same speed
                   ifelse speed > [ speed ] of car-ahead
                             [ ifelse [ x-distance ] of car-ahead <= safety-distance [set speed [speed] of car-ahead - front-assist-deceleration ]
                                                                                     [set speed ((speed - [speed] of car-ahead) / (front-assist-range -  safety-distance)  * ([ x-distance ] of car-ahead - safety-distance) * deceleration-coef  + [speed] of car-ahead ) ]]
                                                                                    ;[set speed speed - front-assist-deceleration]]
                             [speed-up-car]]
                  [;; if you are a "manual" car, slow down so you are driving more slowly than the car ahead of you
                   set speed [ speed ] of car-ahead - deceleration]
end 

to speed-up-car ;; turtle procedure
  ifelse color = green or color = orange [set speed speed + front-assist-acceleration] [set speed speed + acceleration]
end 

to-report x-distance
  report distancexy [ xcor ] of myself ycor
end 

to-report y-distance
  report distancexy xcor [ ycor ] of myself
end 
; Copyright 1997 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created about 2 years ago by Philippe BALMAS.

Attached files

File Type Description Last updated
Front Assist Cars benefits on traffic accordions.png preview Preview for 'Front Assist Cars benefits on traffic accordions' about 2 years ago, by Philippe BALMAS Download

This model does not have any ancestors.

This model does not have any descendants.