Library prosa.behavior.ready
From mathcomp Require Export ssreflect ssrnat ssrbool eqtype fintype bigop.
Require Export prosa.behavior.service.
Require Export prosa.behavior.service.
Readiness of a Job
Class JobReady (Job : JobType) (PState : Type)
`{ProcessorState Job PState} `{JobCost Job} `{JobArrival Job} :=
{
job_ready : schedule PState → Job → instant → bool;
`{ProcessorState Job PState} `{JobCost Job} `{JobArrival Job} :=
{
job_ready : schedule PState → Job → instant → bool;
What follows is the consistency requirement: We require any
reasonable readiness model to consider only pending jobs to be
ready.
Backlogged Jobs
Consider any kinds of jobs and any kind of processor state.
Allow for any notion of readiness.
Job j is backlogged at time t iff it is ready and not scheduled.
Definition backlogged (sched : schedule PState) (j : Job) (t : instant) :=
job_ready sched j t && ~~ scheduled_at sched j t.
End Backlogged.
job_ready sched j t && ~~ scheduled_at sched j t.
End Backlogged.
Validity of a Schedule
Consider any kind of jobs and any kind of processor state.
Consider any schedule.
We define whether jobs come from some arrival sequence...
Definition jobs_come_from_arrival_sequence (arr_seq : arrival_sequence Job) :=
∀ j t, scheduled_at sched j t → arrives_in arr_seq j.
∀ j t, scheduled_at sched j t → arrives_in arr_seq j.
..., whether a job can only be scheduled if it has arrived ...
Definition jobs_must_arrive_to_execute :=
∀ j t, scheduled_at sched j t → has_arrived j t.
Context `{JobCost Job}.
Context `{JobReady Job PState}.
∀ j t, scheduled_at sched j t → has_arrived j t.
Context `{JobCost Job}.
Context `{JobReady Job PState}.
..., whether a job can only be scheduled if it is ready ...
... and whether a job cannot be scheduled after it completes.
Definition completed_jobs_dont_execute :=
∀ j t, scheduled_at sched j t → service sched j t < job_cost j.
∀ j t, scheduled_at sched j t → service sched j t < job_cost j.
We say that the schedule is valid iff
- jobs come from some arrival sequence
- a job is scheduled if it is ready
Definition valid_schedule (arr_seq : arrival_sequence Job) :=
jobs_come_from_arrival_sequence arr_seq ∧
jobs_must_be_ready_to_execute.
jobs_come_from_arrival_sequence arr_seq ∧
jobs_must_be_ready_to_execute.
Note that we do not explicitly require that a valid schedule satisfies
jobs_must_arrive_to_execute or completed_jobs_dont_execute because these
properties are implied by jobs_must_be_ready_to_execute.