uses TestHelp module
This commit is contained in:
parent
4a595665dc
commit
ae039e75be
|
@ -18,11 +18,9 @@ def test(tasks):
|
||||||
""" The Hyperbolic bound is given as Π(U + 1) of all 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
|
# compute the hyperbolic bound as product of the U_factor of each task + 1
|
||||||
hb = 1
|
hb = 1
|
||||||
for i in range(len(tasks)): # len(tasks) is 10
|
for i in range(tasks.shape[0]): # len(tasks) is 10
|
||||||
# print("Task #{}: P_i={} = D_i ={}, C_i={}".format(i, tasks[i][0], tasks[i][1], tasks[i][2]))
|
hb *= (TH.C_i(tasks, i) / TH.P_i(tasks, i)) + 1
|
||||||
hb *= (tasks[i][2] / tasks[i][0]) + 1
|
|
||||||
# compare this computed bound to 2.0
|
# compare this computed bound to 2.0
|
||||||
# if greater then no guaranty of schedulability
|
# if greater then no guaranty of schedulability
|
||||||
# otherwise task set is schedulable
|
# otherwise task set is schedulable
|
||||||
print("Hyperbolic bound: {}".format(hb))
|
|
||||||
return hb <= 2.0
|
return hb <= 2.0
|
||||||
|
|
Loading…
Reference in New Issue