Skip to content

Commit

Permalink
Revert Round Robin in master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sjathin committed Sep 14, 2020
1 parent 6fa70c2 commit 82b5926
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 56 deletions.
5 changes: 0 additions & 5 deletions SchedulingSimulator/Main/rr.py

This file was deleted.

6 changes: 2 additions & 4 deletions SchedulingSimulator/Main/schedulingAlgorithm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Main import rms, edf, fcfs, sjf, rr
from Main import rms, edf, fcfs, sjf


def schedule(algorithmInputArray):
Expand All @@ -15,9 +15,7 @@ def schedule(algorithmInputArray):
# calculate shortest job first scheduling algorithm
sjfInputArray = fcfsInputArrayCreator(algorithmInputArray)
sjfArray = sjf.schedule(sjfInputArray)

rrArray = rr.schedule(algorithmInputArray)
return rmsArray, edfArray, fcfsArray, sjfArray, rrArray
return rmsArray, edfArray, fcfsArray, sjfArray

def rmsInputArrayCreator(algorithmInputs):
rmsInputArray = []
Expand Down
4 changes: 2 additions & 2 deletions SchedulingSimulator/Main/static/js/bar-graph-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ var colors = ['#FF6633', '#6b339c', '#d6d43e', '#00B3E6',
'#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF'
];
var lcm = 0;
var startAxes = [0,0,0,0,0];
var endAxes = [50,50,50,50,50];
var startAxes = [0,0,0,0];
var endAxes = [50,50,50,50];


function createGraph(canvasID, title, schedulingArray, inputArray, arrayIndex) {
Expand Down
41 changes: 0 additions & 41 deletions SchedulingSimulator/Main/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,47 +240,6 @@ <h2 class="card-title">Shortest Job First</h2>
</div>
</div>
</div>
<div class="row" id="rrAlgorithm" style="display: block">
<div class="col-12">
<div class="card card-chart">
<div class="card-header ">
<div class="row">
<div class="col-sm-6 text-left">
<h2 class="card-title">Round Robin</h2>
</div>
<div class="col-sm-6">
<div class="btn-group btn-group-toggle float-right" data-toggle="buttons">
<label class="btn btn-sm btn-primary btn-simple active" id="8" onclick="chooseGraph('myChart5', 'rrChartArea','nextPrevRrBar','nextPrevRrLine', 4);createGraph('myChart5', 'Round Robin', rrArray, algorithmInputArray, 4)">
<input type="radio" name="options" checked> <span class="d-none d-sm-block d-md-block d-lg-block d-xl-block">Bar Graph</span> <span class="d-block d-sm-none">
<i class="tim-icons icon-single-02"></i>
</span>
</label>
<label class="btn btn-sm btn-primary btn-simple" id="9" onclick="chooseGraph('myChart5Line', 'rrChartArea','nextPrevRrBar','nextPrevRrLine', 4);createLineGraph('myChart5Line', 'Round Robin', rrArray, algorithmInputArray, 4)">
<input type="radio" class="d-none d-sm-none" name="options"> <span class="d-none d-sm-block d-md-block d-lg-block d-xl-block">Line Graph</span> <span class="d-block d-sm-none">
<i class="tim-icons icon-gift-2"></i>
</span>
</label>
<div id="nextPrevRrBar" style="display: block;margin-left:40px;">
<button onclick="prevBar('myChart5', 'Round Robin', rrArray, algorithmInputArray,'rrChartArea', 4)" class="btn-sm btn-white" >&#8249;</button>
<button onclick="nextBar('myChart5', 'Round Robin', rrArray, algorithmInputArray,'rrChartArea', 4)" class="btn-sm btn-white">&#8250;</button>
</div>
<div id="nextPrevRrLine" style="display: none;margin-left:40px;">
<button onclick="prevLine('myChart5Line', 'Round Robin', rrArray, algorithmInputArray,'rrChartArea', 4)" class="btn-sm btn-white" >&#8249;</button>
<button onclick="nextLine('myChart5Line', 'Round Robin', rrArray, algorithmInputArray,'rrChartArea', 4)" class="btn-sm btn-white">&#8250;</button>
</div>
</div>
</div>
</div>
</div>
<div>
<div id="rrChartArea">
<canvas id="myChart5"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">

Expand Down
1 change: 0 additions & 1 deletion SchedulingSimulator/Main/templates/indexExtJs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>

<script>
rrArray = {{ rrArray }}
sjfArray = {{ sjfArray }}
fcfsArray = {{ fcfsArray }}
edfArray = {{ edfArray }}
Expand Down
6 changes: 3 additions & 3 deletions SchedulingSimulator/Main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ def openSimulator(request) :
# splitting the input into desired format
algorithmInputArray = arraySplit(final_array)
# calculating rate monotonic scheduling algorithm
rmsArray, edfArray, fcfsArray, sjfArray, rrArray = schedulingAlgorithm.schedule(algorithmInputArray)
rmsArray, edfArray, fcfsArray, sjfArray = schedulingAlgorithm.schedule(algorithmInputArray)
# formating the input array to send it back to screen
algorithmInputArray = returnInputArray(algorithmInputArray)

# writing standard output to variable
outputConsole = new_stdout.getvalue()
sys.stdout = old_stdout # setting the standard output back to console

return render(request, 'index.html',{'rrArray': rrArray, 'sjfArray': sjfArray, 'fcfsArray': fcfsArray, 'edfArray': edfArray, 'rmsArray': rmsArray, 'noOfTasks': noOfTasks,'algorithmInputArray': algorithmInputArray, 'form': form, 'outputConsole': outputConsole})
return render(request, 'index.html',{'sjfArray': sjfArray, 'fcfsArray': fcfsArray, 'edfArray': edfArray, 'rmsArray': rmsArray, 'noOfTasks': noOfTasks,'algorithmInputArray': algorithmInputArray, 'form': form, 'outputConsole': outputConsole})
else:
form = UserCreationForm()
outputConsole = new_stdout.getvalue()
sys.stdout = old_stdout # setting the standard output back to console
return render(request, 'index.html', {'rrArray': [], 'sjfArray': [], 'fcfsArray': [], 'edfArray': [], 'rmsArray': [], 'noOfTasks': [],'algorithmInputArray': [], 'form': form, 'outputConsole': outputConsole})
return render(request, 'index.html', {'sjfArray': [], 'fcfsArray': [], 'edfArray': [], 'rmsArray': [], 'noOfTasks': [],'algorithmInputArray': [], 'form': form, 'outputConsole': outputConsole})


def arraySplit(algorithmInputs):
Expand Down

0 comments on commit 82b5926

Please sign in to comment.