From a9d8499bbdfc69b24b65d38c370616a4f79e6b1c Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Tue, 27 Nov 2012 12:30:52 +0100 Subject: Add bound_demand() to TaskSet This corresponds to h(t) in Zhang and Burns (2009)'s QPA paper. --- native/src/tasks.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'native/src/tasks.cpp') diff --git a/native/src/tasks.cpp b/native/src/tasks.cpp index 1d784bf..0d0624c 100644 --- a/native/src/tasks.cpp +++ b/native/src/tasks.cpp @@ -152,6 +152,17 @@ unsigned long TaskSet::k_for_epsilon(unsigned int idx, return (unsigned long) ceil(std::max(0.0, bound.get_d())); } +void TaskSet::bound_demand(const integral_t &time, integral_t &demand) const +{ + integral_t task_demand; + demand = 0; + for (unsigned int i = 0; i < tasks.size(); i++) + { + tasks[i].bound_demand(time, task_demand); + demand += task_demand; + } +} + void TaskSet::approx_load(fractional_t &load, const fractional_t &epsilon) const { fractional_t density; -- cgit v1.2.2