uses TestHelp module

This commit is contained in:
Mukendi Mputu 2022-06-24 20:17:52 +02:00
parent 4a595665dc
commit ae039e75be
Signed by: samy.mputu
GPG Key ID: 492A6E5AC70F6B0B
1 changed files with 2 additions and 4 deletions

View File

@ -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