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 processe.
- environment/ Defines the simulation environment, including traffic scenarios and dynamic.
- myenv/ Custom environment configurations and setup.
- nets/ Network configurations and related file.
- record/ Logs and records of simulation runs and result.
- weights/ Pre-trained model weights and checkpoint.
- main.py The main script to initiate training or evaluation processe.
- networks.py Defines the neural network architectures used by agent.
- replay.py Implements the experience replay mechanism for training stabilit.
- plots.py Scripts for visualizing results and performance metric.
- requirements.txt Lists all Python dependencies required to run the projec.
- *Reinforcement Learning-Based Control: Utilizes advanced RL algorithms to manage traffic signals dynamicaly.
- *Customizable Environments: Easily modify and configure different traffic scenarios for testig.
- *Performance Visualization: Generate plots to analyze traffic flow and agent performance over tie.
- *Modular Design: Structured codebase allowing for easy extensions and modificatios.
- *Programming Language: Pyhon
- Libraries and Frameworks:
- TensorFlow / PyTorch (depending on implementaton)
- NmPy
- Matplolib
- OpenAI Gym (for environment simulaton)
- Simulation Tools:
- SUMO (Simulation of Urban MObilty)
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 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 traning:
python main.py --train
-
Evaluating the Agent: - To evaluate the performance of a trained gent:
python main.py --evaluate
-
Visualizing Results: - Generate performance lots:
python plots.py
The project includes visualization tools to assess the performance of the reinforcement learning gnts. For example, average_queue_plot_20241117.png
illustrates the average queue length over time, indicating improvements in traffic flow as the agent earns.
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 Reqest
Please ensure your code adheres to the project's coding standards and includes relevan tests.
This project is licensed under the MIT License. See the LICENSE file fordetails.
For any inquiries or feedback, please contact [email protected].