Skip to content

This repository hosts an interactive traffic simulation where users can control a car in real time, observing traffic dynamics and congestion. πŸš— Explore the simulation with MATLAB R2023a and enjoy visualizing trajectories and animations. πŸ›£οΈ

License

Notifications You must be signed in to change notification settings

nonamebruhyes/interactive_traffic_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Interactive Traffic Simulation πŸš—πŸŒ

Welcome to the Interactive Traffic Simulation repository! In this project, you can immerse yourself in a ring-road multi-lane traffic environment. Take control of a car, change lanes, accelerate, and decelerate in real-time. You can even create congestion and observe the dynamics of traffic through time-space diagrams of trajectories.

Download Releases

Table of Contents

Introduction

Traffic simulations are essential for understanding vehicle behavior and traffic flow. This project allows users to experience and manipulate traffic in a controlled environment. You can explore how vehicles interact, how congestion forms, and how stop-and-go waves occur.

Features

  • Interactive Control: Take the wheel and control your vehicle's speed and lane position.
  • Real-Time Simulation: Experience live traffic dynamics and changes as you drive.
  • Traffic Visualization: View time-space diagrams to understand vehicle trajectories and traffic flow.
  • Customizable Settings: Adjust parameters to simulate different traffic conditions and behaviors.
  • Educational Tool: Use the simulation for learning about traffic dynamics and vehicle interactions.

Installation

To get started with the Interactive Traffic Simulation, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/nonamebruhyes/interactive_traffic_simulation.git
    cd interactive_traffic_simulation
  2. Install Dependencies: Make sure you have Python installed. Then, install the required packages:

    pip install -r requirements.txt
  3. Download the Latest Release: Visit the Releases section to download the latest version of the simulation. Execute the downloaded file to run the simulation.

Usage

After installation, you can run the simulation using the following command:

python main.py

Once the simulation starts, you can control your vehicle using the following keys:

  • Arrow Up: Accelerate
  • Arrow Down: Decelerate
  • Arrow Left: Change to the left lane
  • Arrow Right: Change to the right lane

You can observe how your actions affect traffic flow and the formation of congestion.

Understanding Traffic Dynamics

Traffic dynamics can be complex. This simulation aims to simplify and visualize these interactions. Here are some key concepts:

Car Following

Car following models describe how vehicles maintain a safe distance from one another. The simulation implements basic car-following rules, allowing you to see how your vehicle reacts to those in front.

Lane Changing

Lane changing is crucial for maintaining smooth traffic flow. In this simulation, you can change lanes and see how it affects surrounding vehicles.

Congestion

Congestion often occurs due to various factors, including lane changes and sudden stops. The simulation allows you to create and observe congestion in real-time.

Time-Space Diagrams

These diagrams visualize vehicle trajectories over time. You can generate these diagrams to analyze traffic flow and identify patterns.

Contributing

We welcome contributions to improve this project. Here’s how you can help:

  1. Fork the Repository: Click on the "Fork" button at the top right of this page.
  2. Create a Branch: Create a new branch for your feature or bug fix.
    git checkout -b feature/YourFeature
  3. Make Changes: Implement your changes and commit them.
    git commit -m "Add your message here"
  4. Push to Your Branch:
    git push origin feature/YourFeature
  5. Create a Pull Request: Go to the original repository and click "New Pull Request."

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or feedback, please reach out via GitHub issues or contact me directly at [email protected].

View Releases

Thank you for checking out the Interactive Traffic Simulation! Enjoy driving and exploring the dynamics of traffic.

About

This repository hosts an interactive traffic simulation where users can control a car in real time, observing traffic dynamics and congestion. πŸš— Explore the simulation with MATLAB R2023a and enjoy visualizing trajectories and animations. πŸ›£οΈ

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages