linear_priority_function#

scheduler.prioritization.linear_priority_function(time_delta: float, job: Job, max_exec: int, job_count: int) float[source]#

Compute the Jobs default linear priority.

Linear Job prioritization such that the priority increases linearly with the amount of time that a Job is overdue. At the exact time of the scheduled execution, the priority is equal to the Jobs weight.

The function is defined as

\left(\mathtt{time\_delta},\mathtt{weight}\right)\ {\mapsto}\begin{cases} 0 & :\ \mathtt{time\_delta}<0\\ {\left(\mathtt{time\_delta}+1\right)}\cdot\mathtt{weight} & :\ \mathtt{time\_delta}\geq0 \end{cases}

Parameters:
time_deltafloat

The time in seconds that a Job is overdue.

jobJob

The Job instance

max_execint

Limits the number of overdue Jobs that can be executed by calling function Scheduler.exec_jobs().

job_countint

Number of scheduled Jobs

Returns:
float

The time dependant priority for a Job