A simulation developed from scratch using Pygame to simulate the movement of vehicles across a traffic intersection having traffic lights with a timer. Additional features added to existing basic simulation to take it closer to real-life scenarios and use it effectively in Data Analysis tasks or AI applications.
Vehicle Turning Functionality
- Unlike the previous simulation where all the vehicles went straight through the intersection, some of the vehicles will be turning left, some right, and some will go straight in the modified simulation.Vehicle Type Controller
- This feature lets us choose which vehicle types among car, bus, truck and bike we want in our simulation.Random Green Signal Timer
- If enabled, this feature sets the green signal time equal to a random number generated within a given range.
Find a step-by-step guide to build this simulation here.
The video below shows the final output of the simulation.
- Step I: Clone the Repository
$ git clone https://github.com/mihir-m-gandhi/Traffic-Intersection-Simulation-with-Turns
- Step II: Install the required packages
# On the terminal, move into Traffic-Intersection-Simulation-with-Turns directory
$ cd Traffic-Intersection-Simulation-with-Turns
$ pip install pygame
- Step III: Run the code
# To run simulation
$ python simulation.py
Mihir Gandhi - mihir-m-gandhi
This project is licensed under the MIT - see the LICENSE file for details.