A high-performance traffic intersection simulator built with React and HTML5 Canvas.
- Real-time Simulation: Smooth 60fps canvas-based rendering of vehicles and intersections.
- Custom Traffic Program: Use a specialized DSL to define traffic phases and movements.
- Adaptive Control: System can automatically adjust phase timings based on real-time traffic density.
- Interactive Monitoring: Real-time analytics, congestion charts, and phase logs.
- Responsive Design: Modern, dark-themed UI built with Tailwind CSS.
- Node.js (v18 or higher recommended)
-
Clone the repository:
git clone <repository-url> cd trafficSim
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
You can program the traffic lights using the built-in editor. Each phase defines which movements are allowed to go.
Example:
phase(1):
NORTH_STRAIGHT.GO
NORTH_LEFT.GO
SOUTH_STRAIGHT.GO
- Manual: Manually adjust the duration of each green light phase.
- Adaptive: The system analyzes queue lengths and adjusts timings to minimize congestion.
- React - UI Framework
- Tailwind CSS - Styling
- Lucide React - Icons
- Recharts - Analytics Charts
- Framer Motion - UI Animations