This project aims to optimize traffic flow at crossroads using reinforcement learning techniques. By simulating traffic environments and applying learning algorithms, the system seeks to reduce congestion and improve overall traffic efficiency.
- agents/: Contains the reinforcement learning agents responsible for decision-making processes.
- environment/: Defines the simulation environment, including traffic scenarios and dynamics.
- myenv/: Custom environment configurations and setup.
- nets/: Network configurations and related files.
- record/: Logs and records of simulation runs and results.
- weights/: Pre-trained model weights and checkpoints.
- main.py: The main script to initiate training or evaluation processes.
- networks.py: Defines the neural network architectures used by agents.
- replay.py: Implements the experience replay mechanism for training stability.
- plots.py: Scripts for visualizing results and performance metrics.
- requirements.txt: Lists all Python dependencies required to run the project.
- Reinforcement Learning-Based Control: Utilizes advanced RL algorithms to manage traffic signals dynamically.
- Customizable Environments: Easily modify and configure different traffic scenarios for testing.
- Performance Visualization: Generate plots to analyze traffic flow and agent performance over time.
- Modular Design: Structured codebase allowing for easy extensions and modifications.
- Programming Language: Python
- Libraries and Frameworks:
- TensorFlow / PyTorch (depending on implementation)
- NumPy
- Matplotlib
- OpenAI Gym (for environment simulation)
- Simulation Tools:
- SUMO (Simulation of Urban Mobility)
To set up the project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/devjayswal/Traffic-Optimization-Using-ReinForcement-Learning-.git
-
Navigate to the Project Directory:
cd Traffic-Optimization-Using-ReinForcement-Learning-
-
Create a Virtual Environment (optional but recommended):
python -m venv venv # On Unix/MacOS source venv/bin/activate # On Windows venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Training the Agent: Run the main script to start training:
python main.py --train
-
Evaluating the Agent: To evaluate the performance of a trained agent:
python main.py --evaluate
-
Visualizing Results: Generate performance plots:
python plots.py
The project includes visualization tools to assess the performance of the reinforcement learning agents. For example, average_queue_plot_20241117.png
illustrates the average queue length over time, indicating improvements in traffic flow as the agent learns.
Contributions are welcome! To contribute:
- Fork the Repository
- Create a New Branch:
git checkout -b feature/YourFeature
- Commit Your Changes:
git commit -m "Add YourFeature"
- Push to the Branch:
git push origin feature/YourFeature
- Open a Pull Request
Please ensure your code adheres to the project's coding standards and includes relevant tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries or feedback, please contact devjayswal404@gmail.com.