ucaiado / cpp-traffic-simulation

Building a concurrent traffic simulation in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concurrent Traffic Simulation

This project is part of the C++ Nanodegree program from Udacity. I develop a traffic simulation in which vehicles move along streets and cross intersections. Each intersection will be equipped with a traffic light. I built a suitable and thread-safe communication protocol between vehicles and intersections to complete the simulation.

Example

Install

To set up your environment to run the code in this repository, start by cloning this project using the --recurse-submodules flag. Afterward, install Docker in your machine and the appropriate Xserver. Then, start both and configure Xserver as explained here. You also may need to edit the environment variable DISPLAY in the docker-compose files in the dcomposes/ folder, depending on your operating system (and add network_mode: "host" if you are using Linux). Currently, it is set up to work on the macOS. Finally, run the following commands. This will start an initial chatbot to test the environment.

$ make docker-build
$ make basic-simulator

Run

In a terminal or command window, navigate to the top-level project directory cpp-traffic-simulation/ (that contains this README) and run the following command, which will start a chatbot using the code implemented in this repository.

$ make complete-simulator

License

The contents of this repository are covered under the MIT License.

About

Building a concurrent traffic simulation in C++

License:MIT License


Languages

Language:C++ 91.4%Language:Dockerfile 4.4%Language:Shell 2.3%Language:Makefile 1.9%