Skip to content

A thread-safe communication protocol between vehicles and intersections to simulate traffic.

Notifications You must be signed in to change notification settings

itornaza/cpp-traffic-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrent Traffic Simulation

This project adds traffic lights functionality to the udacity starter code to satisfy this rubric. The starter code already impements a traffic simulation in which vehicles are moving along streets and are crossing intersections.

This update deals with increasing traffic in the city, where traffic lights are needed for road safety. Each intersection is therefore equipped with a traffic light. Also, this update builds a suitable and thread-safe communication protocol between vehicles and intersections to complete the simulation. In order to achieve that, concepts of concurrent programming (such as mutexes, locks and message queues) are used to implement the traffic lights and their integration into the code base.

Check this video for a simulation run.

Project schematic

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory in the top level directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./traffic_simulation.

About

A thread-safe communication protocol between vehicles and intersections to simulate traffic.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published