- Clone the repository in your local computer.
- Move the backend folder to some other location in your local computer.
- Install latest version of node and npm.
- Run the command "npm install react-router-dom" for working of react router.
- Run the command "npm install socket.io-client" for supporting websocket connection
- For flask, run the below commands in terminal "pipenv install flask-socketio" , "pip install flask-socketio" for supporting websocket connection.
- In the backend folder, inside backend.py file, change cpp_file to the actual location of main.cpp as per your computer (line no 15 of backend.py in backend folder)
- For backend, inside backend folder, run the following command "python backend.py" in terminal
- For frontend, run the following command "npm start" in terminal
- Webpage will open. Click getstarted button, then enter the number of process, upload the input.txt file from the backend folder, click on submit.
- Click on view results. You will be directed to new page. Click on "Click to compare performance and statistics of different algorithms" button.
Format: name,arrival_time,burst_time Sample
The project helps users to schedule processes, given their arrival times and burst times, using each of the following algorithms:
First Come First Serve (FCFS) Shortest Job First (SJF) Shortest Remaining Time First (SRTF) Round Robin (RR)
First Come First Serve (FCFS) is the simplest scheduling algorithm where the process that arrives first gets executed first. The steps involved in FCFS are:
- Sort the processes by their arrival times.
- Schedule the processes in the order of their arrival times.
- Execute the processes sequentially, without preemption.
Shortest Job First (SJF) is a non-preemptive scheduling algorithm where the process with the shortest burst time is selected for execution next. The steps involved in SJF are:
- Maintain a priority queue with pairs of {process, burst time}.
- Sort the processes based on their burst times.
- After every process gets executed, select the process with the shortest burst time from the priority queue and execute it.
Shortest Remaining Time First (SRTF) is a preemptive version of the SJF algorithm. Here, the process with the shortest remaining burst time is selected for execution, and the currently running process can be preempted if a new process with a shorter burst time arrives. The steps involved in SRTF are:
- Maintain a priority queue with pairs of {process, remaining burst time}.
- Sort the processes based on their remaining burst times.
- Check for new processes at every unit of time.
- If a new process arrives and its burst time is shorter than the remaining time of the current process, preempt the current process and execute the new process.
Round Robin (RR) is a preemptive scheduling algorithm where each process gets executed for a fixed time slice (quantum) in a cyclic order. The steps involved in RR are:
- Maintain a queue of processes.
- Assign a time quantum to each process.
- Execute the processes for the assigned time quantum.
- If a process does not complete within the time quantum, move it to the end of the queue and continue with the next process.
- Repeat the steps until all processes are completed.
sample For better quality, download the images