How adityaph-17/cpu-scheduling-lab works
CPU Scheduling Lab is a Flask-backed teaching platform for entering process workloads, simulating or comparing six scheduling algorithms, and visualizing schedules and their underlying data structures. The main flow runs from the browser through API validation and scheduling to JSON results rendered in the frontend. The algorithms, data structures, and process model are supported by sampled source; UI/API wiring is shown where excerpts document it. The HTML template and styling are present in the tree but were not sampled, so their internal behavior is not inferred.
Main entry points: app.py Flask API · algorithms.py Algorithm simulation · script.js Scheduling UI · index.html Lab page
Components 14
Web interface
- Scheduling UI
static/script.js - Lab page
templates/index.html - Schedule visualizations
static/script.js - Interface styling
static/style.css
API layer
- Flask API
app.py - Workload presets
app.py
Scheduling engine
- Input validation
scheduler/algorithms.py - Algorithm simulation
scheduler/algorithms.py - Algorithm comparison
scheduler/algorithms.py - Schedule metrics
scheduler/algorithms.py
Scheduling primitives
- Min-heap
scheduler/data_structures.py - FIFO queue
scheduler/data_structures.py - Process lifecycle
scheduler/process.py
Other components
- Learner
Connections 19
- Learner → Scheduling UI: enters workload
static/script.js - Flask API → Lab page: renders
app.py - Scheduling UI → Flask API: requests comparison
static/script.js - Flask API → Workload presets: serves presets
app.py - Flask API → Input validation: validates input
app.py - Flask API → Algorithm simulation: runs simulation
app.py - Flask API → Algorithm comparison: runs comparison
app.py - Input validation → Process lifecycle: creates processes
scheduler/algorithms.py - Algorithm simulation → Min-heap: uses
scheduler/algorithms.py - Algorithm simulation → FIFO queue: uses
scheduler/algorithms.py - Algorithm simulation → Process lifecycle: executes processes
scheduler/algorithms.py - Algorithm comparison → Algorithm simulation: runs algorithms
scheduler/algorithms.py - Algorithm simulation → Schedule metrics: calculates
scheduler/algorithms.py - Flask API → Scheduling UI: returns JSON results
app.py - Scheduling UI → Schedule visualizations: renders results
static/script.js - Schedule visualizations → Min-heap: visualizes snapshots
- Schedule visualizations → FIFO queue: visualizes snapshots
- Scheduling UI → Interface styling: uses styles
- Lab page → Scheduling UI: loads interface code