Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 508bd9c

Browse files
author
Rohit Kumar
committed
#
1 parent 6fff36d commit 508bd9c

14 files changed

+26
-29
lines changed

9.Disk Scheduling.ipynb

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,44 @@
2626
"cells": [
2727
{
2828
"cell_type": "code",
29-
"execution_count": 3,
29+
"execution_count": 12,
3030
"metadata": {},
3131
"outputs": [
3232
{
3333
"output_type": "stream",
3434
"name": "stdout",
3535
"text": [
36-
"Total Cylinders Crossed : 640\n"
36+
"Service Request : [55, 58, 39, 18, 90, 160, 150, 38, 184]\nService Order : [100, 55, 58, 39, 18, 90, 160, 150, 38]\nTotal Cylinders Crossed : 498\nAverage Sleek Time : 55.333333333333336\n"
3737
]
3838
}
3939
],
4040
"source": [
41+
"# Rohit Kumar | 1900320100131\n",
4142
"# FCFS Disk Scheduling\n",
42-
"process=[98, 183, 37, 122, 14, 124, 65, 67] \n",
43-
"n=abs(53-process[0]) \n",
43+
"\n",
44+
"# Array of Process Request\n",
45+
"service_request=[55, 58, 39, 18, 90, 160, 150, 38, 184] \n",
46+
"service_order = []\n",
47+
"\n",
48+
"# Service Request Order\n",
49+
"print(\"Service Request : \",service_request)\n",
50+
"\n",
51+
"# Basic Initialization\n",
52+
"initial_arm = 100\n",
53+
"\n",
54+
"# For Initial Arm\n",
55+
"service_order.append(initial_arm)\n",
56+
"cylinder_crossed=abs(initial_arm-process[0]) \n",
57+
"\n",
58+
"# Calculations\n",
4459
"for i in range(len(process)-1): \n",
45-
" n+=abs(process[i]-process[i+1]) \n",
46-
"print(\"Total Cylinders Crossed : \",n)"
60+
" cylinder_crossed+=abs(service_request[i]-service_request[i+1]) \n",
61+
" service_order.append(service_request[i])\n",
62+
"\n",
63+
"# Output\n",
64+
"print(\"Service Order : \",service_order)\n",
65+
"print(\"Total Cylinders Crossed : \",cylinder_crossed)\n",
66+
"print(\"Average Sleek Time : \",cylinder_crossed/len(process))\n"
4767
]
4868
},
4969
{

Experiments/21131OSLE01-FCFS.pdf

-441 KB
Binary file not shown.

Experiments/21131OSLE02-SJF.pdf

-473 KB
Binary file not shown.
-311 KB
Binary file not shown.
-278 KB
Binary file not shown.

Experiments/21131OSLE05-SRTF.pdf

-273 KB
Binary file not shown.
-737 KB
Binary file not shown.
-323 KB
Binary file not shown.
-264 KB
Binary file not shown.
-408 KB
Binary file not shown.

0 commit comments

Comments
 (0)