Skip to content

Commit 1fb426b

Browse files
Add Round Robin Analyzer
Compares round robin algorithm for same input for all time quantums and shows graph.
1 parent 413117e commit 1fb426b

File tree

2 files changed

+303
-193
lines changed

2 files changed

+303
-193
lines changed

index.html

+17-13
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ <h3>Preferences :</h3>
2727
<i class="fa fa-refresh"></i>
2828
</button>
2929
</li>
30-
<h3>Algorithms : </h3>
31-
<form id="algorithms">
32-
<input type="radio" name="algo" id="fcfs" checked> <label for="fcfs">First Come First Serve</label> <br>
33-
<input type="radio" name="algo" id="sjf"> <label for="sjf">Shortest Job First</label> <br>
34-
<input type="radio" name="algo" id="srjf"> <label for="srjf">Shortest Remaining Job First</label> <br>
35-
<input type="radio" name="algo" id="rr"> <label for="rr">Round Robin</label> <br>
36-
<input type="radio" name="algo" id="ljf"> <label for="ljf">Longest Job First</label> <br>
37-
<input type="radio" name="algo" id="lrjf"> <label for="lrjf">Longest Remaining Job First</label> <br>
38-
<input type="radio" name="algo" id="hrrn"> <label for="hrrn">Highest Response Ratio Next</label> <br>
39-
<input type="radio" name="algo" id="pnp"> <label for="pnp">Priority Non Preemptive</label> <br>
40-
<input type="radio" name="algo" id="pp"> <label for="pp">Priority Preemptive</label> <br>
30+
<form id="algorithms-form">
31+
<label for="algo"><h3>Algorithms : </h3></label>
32+
<select name="algo" id="algo">
33+
<option value="fcfs">First Come First Serve (FCFS)</option>
34+
<option value="sjf">Shortest Job First (SJF)</option>
35+
<option value="ljf">Longest Job First (LJF)</option>
36+
<option value="srtf">Shortest Remaining Job First (SRTF)</option>
37+
<option value="lrtf">Longest Remaining Job First (LRTF)</option>
38+
<option value="rr">Round Robin</option>
39+
<option value="pnp">Priority (Non Preemptive)</option>
40+
<option value="pp">Priority (Preemptive)</option>
41+
<option value="hrrn">Highest Response Ratio Next (HRRN)</option>
42+
</select>
4143
</form>
4244
<br>
4345
<table class="main-table">
@@ -63,6 +65,9 @@ <h3>Algorithms : </h3>
6365
</tr>
6466
</tbody>
6567
</table>
68+
<br>
69+
<button type="button" class="add-btn">Add Row</button>
70+
<button type="button" class="remove-btn">Delete Row</button>
6671
<div id="context-switch-div">
6772
<br>
6873
<label for="context-switch">Context Switch Time : </label>
@@ -74,9 +79,8 @@ <h3>Algorithms : </h3>
7479
<input type="number" name="Time Quantum" id="tq" min="1" step="1" value="1">
7580
</div>
7681
<br>
77-
<button type="button" class="add-btn">+</button>
78-
<button type="button" class="remove-btn">-</button>
7982
<button type="button" id="calculate">Calculate</button>
83+
<button type="button" id="reset" onClick="window.location.reload();">Reset</button>
8084
<div id="output"></div>
8185
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
8286
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js" integrity="sha512-d9xgZrVZpmmQlfonhQUvTR7lMPtO7NkZMkA0ABN3PHCbKA5nqylQ/yWlFAyY6hYgdF1Qh6nYiuADWwKB4C2WSw==" crossorigin="anonymous"></script>

0 commit comments

Comments
 (0)