scheduling.round_robin

Round Robin is a scheduling algorithm. In Round Robin each process is assigned a fixed time slot in a cyclic way. https://en.wikipedia.org/wiki/Round-robin_scheduling

Attributes

burst_times

Functions

calculate_turn_around_times(→ list[int])

calculate_waiting_times(→ list[int])

Calculate the waiting times of a list of processes that have a specified duration.

Module Contents

scheduling.round_robin.calculate_turn_around_times(burst_times: list[int], waiting_times: list[int]) list[int]
>>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3])
[1, 3, 6]
>>> calculate_turn_around_times([10, 3, 7], [10, 6, 11])
[20, 9, 18]
scheduling.round_robin.calculate_waiting_times(burst_times: list[int]) list[int]

Calculate the waiting times of a list of processes that have a specified duration.

Return: The waiting time for each process. >>> calculate_waiting_times([10, 5, 8]) [13, 10, 13] >>> calculate_waiting_times([4, 6, 3, 1]) [5, 8, 9, 6] >>> calculate_waiting_times([12, 2, 10]) [12, 2, 12]

scheduling.round_robin.burst_times = [3, 5, 7]