From 0b38b8c17c7a59acb3fb7f786a0f105370b35a62 Mon Sep 17 00:00:00 2001 From: bhatvineeth <59833585+bhatvineeth@users.noreply.github.com> Date: Thu, 11 Jun 2020 21:39:19 +0200 Subject: [PATCH] Empty array check in JS. --- SchedulingSimulator/Main/edf.py | 1 + SchedulingSimulator/Main/fcfs.py | 1 + SchedulingSimulator/Main/static/js/bar-graph-controller.js | 3 +++ 3 files changed, 5 insertions(+) diff --git a/SchedulingSimulator/Main/edf.py b/SchedulingSimulator/Main/edf.py index 5fd0c59..1c16416 100644 --- a/SchedulingSimulator/Main/edf.py +++ b/SchedulingSimulator/Main/edf.py @@ -23,6 +23,7 @@ def earliestDeadlineFirstAlgorithm(tasks): if u > 1: print("The tasks are not feasible", file=logFile) print("Processes are not schedulable") + print("\n-------------------------------------------------\n") return []; else: diff --git a/SchedulingSimulator/Main/fcfs.py b/SchedulingSimulator/Main/fcfs.py index 0a8244b..dbc3a3b 100644 --- a/SchedulingSimulator/Main/fcfs.py +++ b/SchedulingSimulator/Main/fcfs.py @@ -87,6 +87,7 @@ def findavgTime(processes, n, bt, at): resultArray.append(resultTasks) print("Average waiting time = %.5f " % (total_wt / n)) print("Average turn around time = ", total_tat / n) + print("\n-------------------------------------------------\n") return resultArray diff --git a/SchedulingSimulator/Main/static/js/bar-graph-controller.js b/SchedulingSimulator/Main/static/js/bar-graph-controller.js index 3baf469..7231f62 100644 --- a/SchedulingSimulator/Main/static/js/bar-graph-controller.js +++ b/SchedulingSimulator/Main/static/js/bar-graph-controller.js @@ -11,6 +11,9 @@ var colors = ['#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6', ]; function createGraph(canvasID, title, schedulingArray, inputArray) { + if(schedulingArray.length == 0 ){ + return; + } var labels = []; var data = generateGraph(schedulingArray); var dataSet = [];