From 416f5a30082cca09514560c146a94f183017ded0 Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Mon, 21 Nov 2016 10:11:24 +0100 Subject: [PATCH] Fixed error in utilization calculation. --- tasksetgen.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasksetgen.py b/tasksetgen.py index 75330bc..e4f24ef 100755 --- a/tasksetgen.py +++ b/tasksetgen.py @@ -81,7 +81,7 @@ class Task: self.period = int(period) self.deadline = int(deadline) -def check_taskset(procs, tasklist): +def calc_utilization(tasklist): sum = 0 for task in tasklist: sum += task.wcet / task.period @@ -179,7 +179,7 @@ def main(): while len(tasksets) < args.tasksetcount: taskset = [] while len(taskset) < args.cores + 1 or \ - check_taskset(args.cores, taskset) <= 1 and \ + calc_utilization(taskset) <= args.cores and \ hyperperiod(taskset) < 300000: # Limit hyperperiod to 5 minutes taskset.append(create_task(distribution)) if len(taskset) >= args.cores + 1: @@ -208,7 +208,7 @@ def main(): out['deadline'] = task.deadline task_out.append(out) - utilization = str(round(check_taskset(args.cores, taskset), 2)) + utilization = str(round(calc_utilization(taskset), 2)) utilization.replace('.', '_') name = 'taskset_{}_{}_{}'.format(now.strftime('%Y_%m_%d_%H_%M_%S'), -- libgit2 0.26.0