pub struct Task {
pub offset: TimeUnit,
pub demand: TimeUnit,
pub interval: TimeUnit,
}
Expand description
The Task type based on the Modeling described in the second paragraph of Chapter 3. in the paper
Fields§
§offset: TimeUnit
The offset of the tasks, O index i in the paper
demand: TimeUnit
The demand induced by the task called the worst-case execution time (WCET) C index i in the paper
interval: TimeUnit
The interval of the task, called Period P index i in the paper
Implementations§
Source§impl Task
impl Task
Sourcepub fn new<I: Into<TimeUnit>>(demand: I, interval: I, offset: I) -> Self
pub fn new<I: Into<TimeUnit>>(demand: I, interval: I, offset: I) -> Self
Create a new Task with the corresponding parameters
§Panics
If the interval is shorter than the demand
Sourcepub fn higher_priority_task_demand_iter(
tasks: &[Self],
index: usize,
) -> impl CurveIterator<CurveKind = HigherPriorityTaskDemand> + Clone + '_
pub fn higher_priority_task_demand_iter( tasks: &[Self], index: usize, ) -> impl CurveIterator<CurveKind = HigherPriorityTaskDemand> + Clone + '_
calculate the Higher Priority task Demand for the task with priority index
as defined in Definition 14. (1) in the paper,
for a set of tasks indexed by their priority (lower index <=> higher priority) and up to the specified limit
Sourcepub fn available_execution_curve_impl<'a, HPTD, ASEC>(
constrained_server_execution_curve: ASEC,
higher_priority_task_demand: HPTD,
) -> impl CurveIterator<CurveKind = AvailableTaskExecution> + Clone + 'awhere
HPTD: CurveIterator<CurveKind = HigherPriorityTaskDemand> + Clone + 'a,
ASEC: CurveIterator<CurveKind = ActualServerExecution> + Clone + 'a,
pub fn available_execution_curve_impl<'a, HPTD, ASEC>(
constrained_server_execution_curve: ASEC,
higher_priority_task_demand: HPTD,
) -> impl CurveIterator<CurveKind = AvailableTaskExecution> + Clone + 'awhere
HPTD: CurveIterator<CurveKind = HigherPriorityTaskDemand> + Clone + 'a,
ASEC: CurveIterator<CurveKind = ActualServerExecution> + Clone + 'a,
Calculate the available execution Curve for the task with priority task_index
of the server with priority server_index
up to the specified limit.
Based on Definition 14. (2) of the paper
Sourcepub fn original_actual_execution_curve_iter<'a>(
system: &'a System<'_>,
server_index: usize,
task_index: usize,
) -> impl CurveIterator<CurveKind = ActualTaskExecution> + Clone + 'a
pub fn original_actual_execution_curve_iter<'a>( system: &'a System<'_>, server_index: usize, task_index: usize, ) -> impl CurveIterator<CurveKind = ActualTaskExecution> + Clone + 'a
Calculate the actual execution Curve for the Task with priority task_index
of the Server with priority server_index
up to the specified limit.
Based on Definition 14. (3) of the paper
pub fn fixed_actual_execution_curve_iter<'a>( system: &'a System<'_>, server_index: usize, task_index: usize, ) -> impl CurveIterator<CurveKind = ActualTaskExecution> + Clone + 'a
Sourcepub fn original_worst_case_response_time(
system: &System<'_>,
server_index: usize,
task_index: usize,
arrival_before: TimeUnit,
) -> TimeUnit
pub fn original_worst_case_response_time( system: &System<'_>, server_index: usize, task_index: usize, arrival_before: TimeUnit, ) -> TimeUnit
Calculate the WCRT for the task with priority task_index
for the Server with priority server_index
See definition 15. of the paper for reference
Takes the system of servers that the task which worst case execution time shall be calculated is part of the priority/index of the server the Task belongs to and the tasks priority/index in that server as well as the time till which jobs that arrive prior shall be considered for the analysis
§Panics
When sanity checks fail
pub fn fixed_worst_case_response_time( system: &System<'_>, server_index: usize, task_index: usize, arrival_before: TimeUnit, ) -> TimeUnit
Sourcepub fn time_to_provide(
actual_execution_time: &Curve<ActualTaskExecution>,
t: TimeUnit,
) -> TimeUnit
pub fn time_to_provide( actual_execution_time: &Curve<ActualTaskExecution>, t: TimeUnit, ) -> TimeUnit
Calculate the time till the execution curve has served t Units of Demand Implementing Algorithm 5. form the paper
§Panics
When the capacity of the curve is less than t
or t is TimeUnit::ZERO
Sourcepub fn job_arrival(&self, job_index: UnitNumber) -> TimeUnit
pub fn job_arrival(&self, job_index: UnitNumber) -> TimeUnit
Calculate the arrival for the job_index+1-th job
Note: The paper uses 1-index for jobs while this uses 0-index