From e398f3a492770040a3dbd39d2a741a0e8615413c Mon Sep 17 00:00:00 2001 From: Mukendi Mputu Date: Fri, 24 Jun 2022 20:18:19 +0200 Subject: [PATCH] =?UTF-8?q?correct=20implementation=20of=20the=20LLB=20?= =?UTF-8?q?=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schedTests/LiuAndLaylandBound.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/schedTests/LiuAndLaylandBound.py b/schedTests/LiuAndLaylandBound.py index 7063402..6f6cb1a 100644 --- a/schedTests/LiuAndLaylandBound.py +++ b/schedTests/LiuAndLaylandBound.py @@ -14,9 +14,14 @@ import include.TasksHelper as TH #The necessary Test for the Liu and Layland Bound def test(tasks): + n = tasks.shape[0] + U = TH.getTotalUtilization(tasks=tasks, NrTasks=n) + U_lub = n * ((2 ** (1 / n)) - 1) + + # for fewer tasks than 10, we use the exact computed least upper bound + if n < 10: + return U <= U_lub - ##################### - #YOUR CODE GOES HERE# - ##################### + # from 10 tasks up unlimited, we use the limes of n(2 ** 1/n - 1) + return U <= np.log(2) # round to 0.7 ? - return False