A traffic management system that models intersections as resource allocation problems and uses the Banker's Algorithm to prevent deadlocks.
In this system:
- Each direction of traffic (North, South, East, West) is modeled as a process
- Green signals and lanes are modeled as resources
- The Banker's Algorithm is used to detect and prevent potential deadlocks
- A simulation visualizes traffic flow and demonstrates deadlock prevention
src/: Source codealgorithm/: Implementation of the Banker's Algorithmsimulation/: Traffic simulation logicui/: User interface components
assets/: Images and other static resourcestests/: Test cases
- Install dependencies:
pip install -r requirements.txt - Run the simulation:
python src/main.py