This is an interactive web-based visualization of the Priority Preemptive Scheduling algorithm for an Air Traffic Control system, based on the C program implementation.
- Real-time Animation: Watch aircraft landing in real-time with smooth animations
- Priority-based Scheduling: Implements priority preemptive scheduling (lower number = higher priority)
- Interactive Controls: Start, pause, reset, and adjust simulation speed
- Dynamic Aircraft Management: Add new aircraft during simulation
- Comprehensive Logging: Detailed simulation log with timestamps
- Statistics Display: Real-time turnaround and waiting time calculations
The visualization simulates an airport runway system where:
- Aircraft arrive at different times with different landing time requirements
- Priority levels: 1 (Emergency), 2 (Fuel Shortage), 3+ (Normal)
- Preemptive scheduling: Higher priority aircraft can preempt lower priority ones currently landing
- Real-time animation: Shows aircraft movement, queue status, and progress
-
Install dependencies:
npm install
-
Start the server:
npm start
-
Open browser: Navigate to
http://localhost:3000
- Start/Pause: Control simulation playback
- Reset: Restart simulation with current aircraft
- Speed Control: Adjust simulation speed (0.5x to 5x)
- Add Aircraft: Add new aircraft with custom parameters
- Runway Canvas: Shows current aircraft landing with progress bar
- Queue Canvas: Displays waiting aircraft in priority order
- Statistics: Shows average turnaround and waiting times
- Log Panel: Real-time simulation events and timestamps
Click "Add Aircraft" to open the modal:
- Arrival Time: When the aircraft arrives (must be ≥ current time)
- Landing Time: Time required for landing (1+ time units)
- Priority: 1 (Emergency), 2 (Fuel Shortage), 3 (Normal)
- Color: Visual representation color
The simulation implements the Priority Preemptive Scheduling algorithm:
- Selection: At each time unit, select the highest priority aircraft that has arrived
- Preemption: If a higher priority aircraft arrives, preempt the current aircraft
- Execution: Process one time unit of the selected aircraft's landing
- Completion: Continue until all aircraft have completed landing
The visualization comes with sample data:
- Aircraft 1: Arrival: 0, Landing: 8, Priority: 2 (Red)
- Aircraft 2: Arrival: 1, Landing: 4, Priority: 1 (Teal) - Emergency
- Aircraft 3: Arrival: 3, Landing: 9, Priority: 3 (Blue) - Normal
- Aircraft 4: Arrival: 5, Landing: 5, Priority: 2 (Yellow)
- Turnaround Time: Total time from arrival to completion
- Waiting Time: Time spent waiting (Turnaround - Landing Time)
- Throughput: Number of aircraft processed per time unit
- Backend: Node.js with Express server
- Frontend: HTML5 Canvas for animations, CSS3 for styling
- Algorithm: Pure JavaScript implementation of priority scheduling
- Real-time Updates: RequestAnimationFrame for smooth 60fps animation
- Chrome 60+
- Firefox 55+
- Safari 11+
- Edge 79+
Requires modern browser with ES6 support and HTML5 Canvas.
MIT License - feel free to use for educational purposes.