Question: Need help, thank you Question 2 [30 pts]: Implement Round Robin Scheduling algorithm using queues in Python. It is the most commonly used algorithm for
Need help, thank you
![Need help, thank you Question 2 [30 pts]: Implement Round Robin Scheduling](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/670fc7936485d_379670fc79343d65.jpg)

Question 2 [30 pts]: Implement Round Robin Scheduling algorithm using queues in Python. It is the most commonly used algorithm for CPU scheduling. a Each process takes an equal share of CPU time. For this question we choose a time quantum of 2 units. I After being processed for a predefined time, if the process still requires more computation, it is passed to a waiting queue. Answer the following questions: . Report the time each process is completed a Report wait times of each process in the queue Wait time = End time Arrival Time Required Time Procesle Arrival Time Required Time P1 0 4 P2 1 3 P3 2 2 P4 3 1 from collections import deque time_quantum = 2 class Process: def __init__(se1f, name, arrival_time, required_time): self.name = name self.arriva1_time arrival_time self.required_time = required_time self.time_processed = 0 ] : from collections import deque time_quantum = 2 : class Process: def _init_(self, name, arrival_time, required_time) : self . name = name self. arrival_time = arrival_time self . required_time = required_time self . time_processed = 0 def _repr_(self) : return self. name : p0 = Process ( 'P1' , 0, 4) p1 = Process ( 'P2' , 1, 3) p2 = Process ( 'P3', 2, 2) p3 = Process ( 'P4', 3, 1) processes = [p0, p1, p2, p3] end_times = {process. name:0 for process in processes} wait_times = {process. name:0 for process in processes} 1 : queue = deque ( ) running_proc = None # Tracks running process in the CPU running_proc_time = 0 # Tracks the time running process spent in the CPU for t in range (11) : ### CODE HERE ### 1 : print (end_times) # End times for each process print (wait_times) # Wait times for each process in the queue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
