How anooragsingh07/cpu-schedsim--cpu-scheduling-simulator- works
Main Components
a. Process Generator – A module (or section of the code) that generates processes with randomized arrival times and CPU burst durations using the Exponential Distribution.
b. Scheduling Algorithm Modules – Although implemented in one file, conceptually separate the logic for the five scheduling algorithms:
• First-Come, First-Served (FCFS)
• Shortest-Job-First (Non-preemptive and Preemptive)
• Round-Robin (with adjustable time slice)
• Preemptive Priority Scheduling
c. Simulation Engine – The core simulation loop that handles the scheduling, context switching (fixed 14ms), tracking process execution, and timing.
d. Output/Analysis Component – This is the part of the simulator that computes process execution order, turnaround times, waiting times, and (in future versions) might provide a Gantt chart view for visualization.
Relationships & Data Flow
• The generated processes flow into the Simulation Engine.
• The Simulation Engine dynamically invokes one or more of the Scheduling Algorithm modules based on the selected scheduling policy.
• The Scheduling Algorithm modules determine which process should run next and communicate process state changes back to the Simulation Engine.
• Finally, the Simulation Engine aggregates the outcomes which are then either printed to the console or used for further analysis (e.g., calculating response times or waiting times).
Relevant Technologies and Frameworks
• The project is written in C++ using standard libraries.
• A possible dependency is the random number generation facilities (to simulate exponential distributions).
• Compiler and build tools (g++) are part of the development environment, though these are secondary for the high-level architecture.