From ae039e75be3e40636edf3aaedfd096d3f5cf2100 Mon Sep 17 00:00:00 2001 From: Mukendi Mputu Date: Fri, 24 Jun 2022 20:17:52 +0200 Subject: [PATCH] uses TestHelp module --- schedTests/HyperbolicBound.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/schedTests/HyperbolicBound.py b/schedTests/HyperbolicBound.py index e92030e..97db93b 100644 --- a/schedTests/HyperbolicBound.py +++ b/schedTests/HyperbolicBound.py @@ -18,11 +18,9 @@ def test(tasks): """ The Hyperbolic bound is given as Π(U + 1) of all tasks: """ # compute the hyperbolic bound as product of the U_factor of each task + 1 hb = 1 - for i in range(len(tasks)): # len(tasks) is 10 - # print("Task #{}: P_i={} = D_i ={}, C_i={}".format(i, tasks[i][0], tasks[i][1], tasks[i][2])) - hb *= (tasks[i][2] / tasks[i][0]) + 1 + for i in range(tasks.shape[0]): # len(tasks) is 10 + hb *= (TH.C_i(tasks, i) / TH.P_i(tasks, i)) + 1 # compare this computed bound to 2.0 # if greater then no guaranty of schedulability # otherwise task set is schedulable - print("Hyperbolic bound: {}".format(hb)) return hb <= 2.0