https://github.com/maxritter/cppnd-traffic-simulation
Traffic simulation using multithreading for the C++ Nanodegree
https://github.com/maxritter/cppnd-traffic-simulation
Last synced: 10 months ago
JSON representation
Traffic simulation using multithreading for the C++ Nanodegree
- Host: GitHub
- URL: https://github.com/maxritter/cppnd-traffic-simulation
- Owner: maxritter
- Created: 2019-07-01T10:41:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-11T07:08:51.000Z (about 7 years ago)
- Last Synced: 2025-04-10T21:04:53.942Z (over 1 year ago)
- Language: C++
- Size: 16.7 MB
- Stars: 1
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ Concurrent Traffic Simulation

This is the project for the fourth course in the [Udacity C++ Nanodegree Program](https://www.udacity.com/course/c-plus-plus-nanodegree--nd213): Concurrency.
It implements traffic lights into a traffic simulation of vehicles driving on streets and turning on intersections. The first car arriving at an intersection will be allowed to enter it and advance, but only if the traffic light is green. If it is not, the car has to wait for the event to happen.
Threads and synchronization mechanisms of C++11 are used to accomplish this task in a concurrent way.
The schematic of the program looks like this:

## Dependencies for Running Locally
* cmake >= 2.8
* All OSes: [click here for installation instructions](https://cmake.org/install/)
* make >= 4.1 (Linux, Mac), 3.81 (Windows)
* Linux: make is installed by default on most Linux distros
* Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
* Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)
* OpenCV >= 4.1
* The OpenCV 4.1.0 source code can be found [here](https://github.com/opencv/opencv/tree/4.1.0)
* gcc/g++ >= 5.4
* Linux: gcc / g++ is installed by default on most Linux distros
* Mac: same deal as make - [install Xcode command line tools](https://developer.apple.com/xcode/features/)
* Windows: recommend using [MinGW](http://www.mingw.org/)
## 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`.