A JavaFX traffic intersection simulation with intelligent traffic light control.
Simulates a four-way intersection with dynamic traffic lights that adapt to congestion. Vehicles can go straight, turn left, or turn right, each indicated by color:
- 🔵 Blue - Straight
- 🟡 Yellow - Left turn
- 🔴 Red - Right turn
- Java 21
- Maven 3.8+
mvn clean compilemvn javafx:run| Key | Action |
|---|---|
| ↑ | Spawn vehicle moving north |
| ↓ | Spawn vehicle moving south |
| ← | Spawn vehicle moving west |
| → | Spawn vehicle moving east |
| R | Spawn vehicle from random direction |
| ESC | Exit simulation |
- Color-coded vehicles by route
- Adaptive traffic light timing based on congestion
- Safe distance maintenance between vehicles
- Collision avoidance at intersection and spawn