scheduling.shortest_job_first

Shortest job remaining first Please note arrival time and burst Please use spaces to separate times entered.

Attributes

no_of_processes

Functions

calculate_average_times(→ None)

This function calculates the average of the waiting & turnaround times

calculate_turnaroundtime(→ list[int])

Calculate the turn around time of each Processes

calculate_waitingtime(→ list[int])

Calculate the waiting time of each processes

Module Contents

scheduling.shortest_job_first.calculate_average_times(waiting_time: list[int], turn_around_time: list[int], no_of_processes: int) None

This function calculates the average of the waiting & turnaround times Prints: Average Waiting time & Average Turn Around Time >>> calculate_average_times([0,3,5,0],[3,6,10,1],4) Average waiting time = 2.00000 Average turn around time = 5.0 >>> calculate_average_times([2,3],[3,6],2) Average waiting time = 2.50000 Average turn around time = 4.5 >>> calculate_average_times([10,4,3],[2,7,6],3) Average waiting time = 5.66667 Average turn around time = 5.0

scheduling.shortest_job_first.calculate_turnaroundtime(burst_time: list[int], no_of_processes: int, waiting_time: list[int]) list[int]

Calculate the turn around time of each Processes Return: list of turn around times. >>> calculate_turnaroundtime([3,3,5,1], 4, [0,3,5,0]) [3, 6, 10, 1] >>> calculate_turnaroundtime([3,3], 2, [0,3]) [3, 6] >>> calculate_turnaroundtime([8,10,1], 3, [1,0,3]) [9, 10, 4]

scheduling.shortest_job_first.calculate_waitingtime(arrival_time: list[int], burst_time: list[int], no_of_processes: int) list[int]

Calculate the waiting time of each processes Return: List of waiting times. >>> calculate_waitingtime([1,2,3,4],[3,3,5,1],4) [0, 3, 5, 0] >>> calculate_waitingtime([1,2,3],[2,5,1],3) [0, 2, 0] >>> calculate_waitingtime([2,3],[5,1],2) [1, 0]

scheduling.shortest_job_first.no_of_processes