AI Insight Add processes and click AI Recommend to get the optimal scheduling algorithm for your workload.

📊 Gantt Chart

Run a simulation to see the Gantt chart

⏱️
—
Avg Waiting Time
🔄
—
Avg Turnaround Time
⚡
—
Avg Response Time
📈
—
CPU Utilization
🚀
—
Throughput
🔁
—
Context Switches

⚖️ Algorithm Comparison

Add processes in the Simulator tab, then click Run All Algorithms to compare side-by-side.

🏗️ OOP Class Design

«abstract» Scheduler
- processes: Process[]
- ganttChart: GanttBlock[]
# currentTime: int
+ schedule(): GanttBlock[]
+ getMetrics(): Metrics
# getAvailableProcesses(): Process[]
# calcWaitingTime(): void
FCFSScheduler
+ schedule()
SJFScheduler
- preemptive: bool
+ schedule()
RoundRobinScheduler
- timeQuantum: int
- readyQueue: Queue<Process>
+ schedule()
PriorityScheduler
- preemptive: bool
+ schedule()
- selectHighest()
SRTFScheduler
- remaining: Map<int,int>
+ schedule()
«AI» AIAdvisor
- analyzers: Analyzer[]
+ recommend()
- scoreAlgorithm()
Process
- pid: string
- arrivalTime: int
- burstTime: int
- priority: int
- remainingTime: int
- startTime: int
- finishTime: int
+ getWaitingTime(): int
+ getTurnaround(): int
+ getResponseTime(): int
+ reset(): void
Metrics
- avgWaitingTime: float
- avgTurnaround: float
- avgResponseTime: float
- cpuUtilization: float
- throughput: float
- contextSwitches: int
+ calculate(processes): void
+ score(): float
GanttBlock
- pid: string
- start: int
- end: int
- color: string

OOP Principles Applied

🔒
Encapsulation
Process attributes are private with controlled access via getters. Each scheduler encapsulates its algorithm logic.
🧬
Inheritance
FCFSScheduler, SJFScheduler, RoundRobinScheduler, PriorityScheduler, SRTFScheduler all inherit from abstract Scheduler class.
🔀
Polymorphism
The schedule() method is overridden in each subclass. A single Scheduler reference can run any algorithm at runtime.
🧩
Abstraction
Abstract Scheduler hides the internal implementation. Clients only interact with schedule() and getMetrics().

AI-Powered CPU Scheduling Simulator

An interactive educational tool demonstrating core OS scheduling concepts through object-oriented design principles and intelligent algorithm analysis.

🤖

AI Recommendation Engine

The AIAdvisor class analyzes workload characteristics — burst time variance, arrival patterns, priority distribution — to recommend the optimal scheduling algorithm.

📐

OOP Architecture

Built with clean OOP principles: an abstract Scheduler base class with 5 concrete algorithm subclasses, a Process entity class, Metrics value object, and AI Advisor.

📊

Visual Gantt Chart

Animated Gantt chart visualization with process color coding, time axis, and step-by-step animation mode showing CPU execution timeline.

⚖️

Algorithm Comparison

Run all 6 scheduling algorithms on the same process set simultaneously and compare performance metrics side by side with bar charts and rankings.

FCFS

First Come First Served

Processes are executed in the order they arrive. Simple but can suffer from the convoy effect.

Non-Preemptive
SJF

Shortest Job First

Selects the process with smallest burst time. Optimal for average waiting time among non-preemptive algorithms.

Non-Preemptive
SRTF

Shortest Remaining Time First

Preemptive version of SJF. CPU is given to process with least remaining time. Theoretically optimal.

Preemptive
Round Robin

Round Robin

Each process gets a time quantum. Fair and provides good response time. Widely used in time-sharing systems.

Preemptive
Priority NP

Priority (Non-Preemptive)

Processes are scheduled based on priority. Higher priority processes run first. Can cause starvation.

Non-Preemptive
Priority P

Priority (Preemptive)

Running process can be preempted by a newly arrived higher-priority process. Dynamic prioritization.

Preemptive