An interactive simulator for learning and testing various CPU scheduling algorithms, including First Come First Serve (FCFS), Round Robin(RR), Shortest Job First(SJF) and Shortest Remaining Time First(SRTF). This project provides a visual and dynamic way to understand scheduling algorithms, making it ideal for students and enthusiasts interested in operating systems.
View the live application here.
This project is a web-based simulator for CPU scheduling algorithms. It allows users to input different processes with specific attributes (arrival time, burst time, etc.) and visualize how these processes are scheduled according to the chosen scheduling algorithm.
- Interactive Form: Add and configure processes with attributes such as arrival time, burst time, and background color.
- Scheduling Algorithms: Currently supports FCFS (First Come First Serve), RR (Round Robin), SJF (Shortest Job First) and SRTF (Shortest Remaining Time First).
- Real-Time Visualization: Watch processes as they are scheduled and executed based on selected algorithms.
- Dark Mode Support: Uses a ThemeProvider for seamless switching between dark and light themes.
- Next.js: Frontend framework for React applications.
- TypeScript: Provides type safety and ensures code robustness.
- Tailwind CSS: Utility-first CSS framework for styling.
- Zod: For form validation schemas.
- React Hook Form: Handles form state and validation.
- Custom Components: Built-in components like
GradientPicker
for user-friendly UI interactions.
To set up the project locally, ensure you have Node.js and Yarn or npm installed.
git clone https://github.com/kautilyadevaraj/SchedulingAlgorithmSimulator
cd scheduling-algorithm-simulator
Run the following command to install the necessary dependencies.
yarn install
npm install
No environment variables are required for this project in its current state. However, if you extend the project with a backend API or database, create a .env.local file in the root directory for environment variables.
Start the development server by running:
yarn dev
npm run dev
This will start the Next.js development server at http://localhost:3000. You can view the project in your browser by navigating to this address.
If you want to build the project for production, run:
yarn build
npm run build
This will create an optimized production build in the .next folder.
- Add Processes: Use the form to add processes with specific arrival times, burst times, and custom background colors.
- Select Algorithm: Choose a scheduling algorithm from the provided options (e.g., SRTF, FCFS).
- Run Simulation: The simulator will display the scheduling results in a real-time animation.
We welcome contributions! To contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (git checkout -b feature-branch-name).
- Make your changes.
- Commit your changes (git commit -m 'Add some feature').
- Push to the branch (git push origin feature-branch-name).
- Open a Pull Request.
For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.