contur2
Loading...
Searching...
No Matches
contur::HrrnPolicy Class Referencefinal

Highest Response Ratio Next (HRRN) scheduling policy. More...

#include <hrrn_policy.h>

Inheritance diagram for contur::HrrnPolicy:
Collaboration diagram for contur::HrrnPolicy:

Public Member Functions

std::string_view name () const noexcept override
 Policy name.
ProcessId selectNext (const std::vector< std::reference_wrapper< const PCB > > &readyQueue, const IClock &clock) const override
 Selects process with highest response ratio.
bool shouldPreempt (const PCB &running, const PCB &candidate, const IClock &clock) const override
 HRRN is non-preemptive once process is running.
Public Member Functions inherited from contur::ISchedulingPolicy
virtual ~ISchedulingPolicy ()=default

Detailed Description

Highest Response Ratio Next (HRRN) scheduling policy.

Selects process maximizing response ratio: (waiting_time + service_time) / service_time.

Definition at line 14 of file hrrn_policy.h.

Member Function Documentation

◆ name()

std::string_view contur::HrrnPolicy::name ( ) const
nodiscardoverridevirtualnoexcept

Policy name.

Implements contur::ISchedulingPolicy.

◆ selectNext()

ProcessId contur::HrrnPolicy::selectNext ( const std::vector< std::reference_wrapper< const PCB > > & readyQueue,
const IClock & clock ) const
nodiscardoverridevirtual

Selects process with highest response ratio.

Implements contur::ISchedulingPolicy.

◆ shouldPreempt()

bool contur::HrrnPolicy::shouldPreempt ( const PCB & running,
const PCB & candidate,
const IClock & clock ) const
nodiscardoverridevirtual

HRRN is non-preemptive once process is running.

Implements contur::ISchedulingPolicy.


The documentation for this class was generated from the following file: