scheduling.highest_response_ratio_next

Highest response ratio next (HRRN) scheduling is a non-preemptive discipline. It was developed as modification of shortest job next or shortest job first (SJN or SJF) to mitigate the problem of process starvation. https://en.wikipedia.org/wiki/Highest_response_ratio_next

Attributes

no_of_process

Functions

calculate_turn_around_time(→ list)

Calculate the turn around time of each processes

calculate_waiting_time(→ list)

Calculate the waiting time of each processes.

Module Contents

scheduling.highest_response_ratio_next.calculate_turn_around_time(process_name: list, arrival_time: list, burst_time: list, no_of_process: int) list

Calculate the turn around time of each processes

Return: The turn around time time for each process. >>> calculate_turn_around_time([“A”, “B”, “C”], [3, 5, 8], [2, 4, 6], 3) [2, 4, 7] >>> calculate_turn_around_time([“A”, “B”, “C”], [0, 2, 4], [3, 5, 7], 3) [3, 6, 11]

scheduling.highest_response_ratio_next.calculate_waiting_time(process_name: list, turn_around_time: list, burst_time: list, no_of_process: int) list

Calculate the waiting time of each processes.

Return: The waiting time for each process. >>> calculate_waiting_time([“A”, “B”, “C”], [2, 4, 7], [2, 4, 6], 3) [0, 0, 1] >>> calculate_waiting_time([“A”, “B”, “C”], [3, 6, 11], [3, 5, 7], 3) [0, 1, 4]

scheduling.highest_response_ratio_next.no_of_process = 5