Commit 416f5a30 by Tobias Langer

Fixed error in utilization calculation.

parent 324d76cf
...@@ -81,7 +81,7 @@ class Task: ...@@ -81,7 +81,7 @@ class Task:
self.period = int(period) self.period = int(period)
self.deadline = int(deadline) self.deadline = int(deadline)
def check_taskset(procs, tasklist): def calc_utilization(tasklist):
sum = 0 sum = 0
for task in tasklist: for task in tasklist:
sum += task.wcet / task.period sum += task.wcet / task.period
...@@ -179,7 +179,7 @@ def main(): ...@@ -179,7 +179,7 @@ def main():
while len(tasksets) < args.tasksetcount: while len(tasksets) < args.tasksetcount:
taskset = [] taskset = []
while len(taskset) < args.cores + 1 or \ 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 hyperperiod(taskset) < 300000: # Limit hyperperiod to 5 minutes
taskset.append(create_task(distribution)) taskset.append(create_task(distribution))
if len(taskset) >= args.cores + 1: if len(taskset) >= args.cores + 1:
...@@ -208,7 +208,7 @@ def main(): ...@@ -208,7 +208,7 @@ def main():
out['deadline'] = task.deadline out['deadline'] = task.deadline
task_out.append(out) task_out.append(out)
utilization = str(round(check_taskset(args.cores, taskset), 2)) utilization = str(round(calc_utilization(taskset), 2))
utilization.replace('.', '_') utilization.replace('.', '_')
name = 'taskset_{}_{}_{}'.format(now.strftime('%Y_%m_%d_%H_%M_%S'), name = 'taskset_{}_{}_{}'.format(now.strftime('%Y_%m_%d_%H_%M_%S'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment