From 5fb5083320dd8a78b774a9116f3011d8ccfa76ec Mon Sep 17 00:00:00 2001 From: Udit Arora Date: Tue, 13 Mar 2018 17:10:29 +0530 Subject: [PATCH] Update pycco docs --- docs/cpu_scheduling.html | 6 +- docs/cpu_screens.html | 441 ++++++++++++++------------- docs/deadlock.html | 6 +- docs/deadlock_avoidance_screens.html | 225 +++++++------- docs/deadlock_detection_screens.html | 181 ++++++----- docs/disk_scheduling.html | 6 +- docs/disk_screens.html | 297 +++++++++--------- docs/main.html | 52 ++-- docs/memory_allocation.html | 6 +- docs/memory_screens.html | 245 ++++++++------- docs/page_replacement.html | 6 +- docs/page_screens.html | 217 +++++++------ 12 files changed, 906 insertions(+), 782 deletions(-) diff --git a/docs/cpu_scheduling.html b/docs/cpu_scheduling.html index a6668c9..6079db5 100644 --- a/docs/cpu_scheduling.html +++ b/docs/cpu_scheduling.html @@ -20,7 +20,11 @@
-
from sys import maxsize
+      
'''
+This file contains the implementation of CPU Scheduling algorithms
+'''
+
+from sys import maxsize
 from operator import itemgetter
 import Queue
 from copy import deepcopy
diff --git a/docs/cpu_screens.html b/docs/cpu_screens.html index 2e2974b..9bab805 100644 --- a/docs/cpu_screens.html +++ b/docs/cpu_screens.html @@ -17,10 +17,25 @@
#
+ +
+
+
'''
+This file contains the classes, functions and globals used for visualizing
+CPU Scheduling algorithms
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.core.window import Window
+      
from kivy.core.window import Window
 from kivy.graphics import Color, Rectangle
 from kivy.properties import ObjectProperty, NumericProperty
 from kivy.uix.scrollview import ScrollView
@@ -36,10 +51,10 @@
     
-
+
- # + #

Python libraries

@@ -49,10 +64,10 @@
-
+
- # + #

OS Algorithms

@@ -61,10 +76,10 @@
-
+
- # + #

OSAVA common constants and methods

@@ -73,10 +88,10 @@
-
+
- # + #

Global data for CPU Scheduling Algorithms

@@ -87,10 +102,10 @@
-
+
- # + #

Binder functions for CPU Scheduling Algorithms form, to store data in the global 'data_cpu' dictionary

@@ -102,10 +117,10 @@
-
+
- # + #
@@ -122,10 +137,10 @@
-
+
- # + #
@@ -142,10 +157,10 @@
-
+
- # + #
@@ -162,10 +177,10 @@
-
+
- # + #
@@ -182,10 +197,10 @@
-
+
- # + #
@@ -202,10 +217,10 @@
-
+
- # + #
@@ -222,10 +237,10 @@
-
+
- # + #
@@ -242,10 +257,10 @@
-
+
- # + #
@@ -262,10 +277,10 @@
-
+
- # + #

Input Screen for CPU Scheduling Algorithms with partial scrolling

@@ -281,10 +296,10 @@
-
+
- # + #

Update dispatch_latency and set to default value if empty

@@ -299,10 +314,10 @@
-
+
- # + #

Called when the number of processes input is changed (Wrapper function to allow for condition checking if required)

@@ -318,10 +333,10 @@
-
+
- # + #

If input is valid, load form else display error message

@@ -335,10 +350,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -348,10 +363,10 @@
-
+
- # + #

Binder function for dispatch latency input def bind_dispatch_latency(self, *args): @@ -362,10 +377,10 @@

-
+
- # + #

Binder function for algorithm type selection from Spinner (Dropdown)

@@ -376,10 +391,10 @@
-
+
- # + #

Wrapper function that calls binder functions for the required widgets

@@ -389,10 +404,10 @@
-
+
- # + #

self.bind_dispatch_latency()

@@ -401,10 +416,10 @@
-
+
- # + #

Call set_cpu_type method with appropriate index of scheduling algorithm

@@ -431,10 +446,10 @@
-
+
- # + #
@@ -449,10 +464,10 @@
-
+
- # + #

Called when a new value is chosen from spinner. Sets cpu_type to the appropriate index in the cpu_scheduling_types list

@@ -464,10 +479,10 @@
-
+
- # + #

If FCFS or RR

@@ -488,10 +503,10 @@
-
+
- # + #

Called when preemptive or non-preemtive option is clicked. Sets cpu_type to the appropriate index in the cpu_scheduling_types list

@@ -501,10 +516,10 @@
-
+
- # + #

If FCFS or RR Scheduling

@@ -520,10 +535,10 @@
-
+
- # + #

Load the appropriate form inputs according to the CPU Scheduling algorithm selected

@@ -532,10 +547,10 @@
-
+
- # + #

Layout is the area where the form is placed on the screen

@@ -545,10 +560,10 @@
-
+
- # + #

Enable visualize button - load_form will only be called when form load input is correct

@@ -559,10 +574,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -571,10 +586,10 @@
-
+
- # + #

Add input labels

@@ -583,10 +598,10 @@
-
+
- # + #

label = Label(text='Sno.') box.add_widget(label)

@@ -601,10 +616,10 @@
-
+
- # + #

If Priority scheduling selected

@@ -620,10 +635,10 @@
-
+
- # + #

sno_label = Label(text=str(i+1)) box.add_widget(sno_label)

@@ -633,10 +648,10 @@
-
+
- # + #

Inputted process names inp = TextInput(id='name'+str(i)) @@ -648,10 +663,10 @@

-
+
- # + #

Fixed process names

@@ -662,10 +677,10 @@
-
+
- # + #

arrival times

@@ -676,10 +691,10 @@
-
+
- # + #

burst times

@@ -690,10 +705,10 @@
-
+
- # + #

If Priority scheduling selected

@@ -707,10 +722,10 @@
-
+
- # + #

If Round Robin scheduling selected

@@ -722,10 +737,10 @@
-
+
- # + #

inp.font_size = inp.size[1]

@@ -737,10 +752,10 @@
-
+
- # + #

If Priority scheduling selected

@@ -752,10 +767,10 @@
-
+
- # + #

inp.font_size = inp.size[1]

@@ -769,10 +784,10 @@
-
+
- # + #

If Multilevel Queue scheduling is selected

@@ -787,10 +802,10 @@
-
+
- # + #

label.bind(size=label.setter('text_size'))

@@ -805,10 +820,10 @@
-
+
- # + #

For occupying space on right side

@@ -821,10 +836,10 @@
-
+
- # + #

Uncomment to insert buttons at end of scroll view if self.cpu_type != 7 and self.cpu_type != 8: @@ -839,10 +854,10 @@

-
+
- # + #

Add dispatch latency input

@@ -863,10 +878,10 @@
-
+
- # + #

Add ScrollView

@@ -877,10 +892,10 @@
-
+
- # + #

Clear the multilevel scheduling sub-form

@@ -892,10 +907,10 @@
-
+
- # + #

Sets the algo of a queue in multilevel queue scheduling

@@ -911,10 +926,10 @@
-
+
- # + #

Called when the number of queues input is changed (Wrapper function to allow for condition checking if required)

@@ -936,10 +951,10 @@
-
+
- # + #
@@ -948,10 +963,10 @@
-
+
- # + #

Remove previous multilevel form widgets

@@ -964,10 +979,10 @@
-
+
- # + #

Iniatilize queue algo data_cpu dictionary lists

@@ -978,10 +993,10 @@
-
+
- # + #

Adding descriptive features

@@ -1004,10 +1019,10 @@
-
+
- # + #

Adding input rows for intra queue scheduling algorithm for each queue

@@ -1036,10 +1051,10 @@
-
+
- # + #

Descriptive features for assigning a queue to every process

@@ -1060,10 +1075,10 @@
-
+
- # + #

Adding input rows to assign a queue to each process

@@ -1081,10 +1096,10 @@
-
+
- # + #

Iniatilize queue algo data_cpu dictionary lists

@@ -1093,10 +1108,10 @@
-
+
- # + #

Descriptive features for assigning a queue to every process

@@ -1130,10 +1145,10 @@
-
+
- # + #

Uncomment to insert buttons at end of scroll view

Add Visualize and back button at the end of form

@@ -1148,10 +1163,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add dispatch latency input

@@ -1173,10 +1188,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -1187,10 +1202,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -1201,10 +1216,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Output Screen for CPU Scheduling algorithms

@@ -1213,10 +1228,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Stores the colours assigned to each process indexed by name

@@ -1225,10 +1240,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Stores the colours assigned to each queue indexed by name

@@ -1237,10 +1252,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Stores the process schedule generated by scheduling algorithm

@@ -1249,10 +1264,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Stores the stats related to schedule like average waiting time

@@ -1261,10 +1276,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Stores the individual per process stats

@@ -1273,10 +1288,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Stores information related to bad input data

@@ -1285,10 +1300,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -1313,10 +1328,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Prints the details of the process schedule and statistics

@@ -1327,10 +1342,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

self.gantt.clear_widgets() self.time.clear_widgets()

@@ -1376,10 +1391,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Make sure the height is such that there is something to scroll

@@ -1388,10 +1403,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add ScrollView

@@ -1404,10 +1419,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Inform the user

@@ -1432,10 +1447,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display process schedule details

@@ -1455,10 +1470,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add view details button for each process

@@ -1468,10 +1483,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Blank label for padding on right

@@ -1480,10 +1495,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Popup showing details of process when box is clicked

@@ -1518,10 +1533,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display statistics

@@ -1548,10 +1563,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -1560,10 +1575,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Area for displaying description.

@@ -1572,10 +1587,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Area for drawing gantt chart

@@ -1585,10 +1600,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Area for displaying time values

@@ -1601,10 +1616,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height) box.add_widget(Label(text='Visualization results' )) @@ -1617,10 +1632,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

desc_label.text_size = desc_label.size

@@ -1630,10 +1645,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Error checking

@@ -1654,10 +1669,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Area for drawing queue gantt chart

@@ -1667,10 +1682,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Area for displaying queue time values

@@ -1684,10 +1699,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Starting position of rectangle

@@ -1696,10 +1711,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Increment in width per unit time

@@ -1708,10 +1723,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add description labels

@@ -1743,10 +1758,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Draw the gantt chart rectangles and add time labels

@@ -1783,10 +1798,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add time label for the end time of last process

@@ -1798,10 +1813,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add the widget used to draw the gantt chart on the screen

@@ -1816,10 +1831,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Starting position of rectangle

@@ -1828,10 +1843,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Increment in width per unit time

@@ -1840,10 +1855,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add description labels

@@ -1856,10 +1871,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Draw the gantt chart rectangles and add time labels

@@ -1881,10 +1896,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add time label for the end time of last process

@@ -1896,10 +1911,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add the widget used to draw the gantt chart on the screen

diff --git a/docs/deadlock.html b/docs/deadlock.html index 801af86..3a4ec24 100644 --- a/docs/deadlock.html +++ b/docs/deadlock.html @@ -20,7 +20,11 @@
-
import copy
+
'''
+This file contains the implementation of Deadlock Detection and Avoidance algorithms
+'''
+
+import copy
diff --git a/docs/deadlock_avoidance_screens.html b/docs/deadlock_avoidance_screens.html index 5208a88..70710b6 100644 --- a/docs/deadlock_avoidance_screens.html +++ b/docs/deadlock_avoidance_screens.html @@ -17,10 +17,25 @@
#
+ +
+
+
'''
+This file contains the classes, functions and globals used for visualizing
+Deadlock Avoidance algorithms
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.properties import ObjectProperty
+      
from kivy.properties import ObjectProperty
 from kivy.uix.scrollview import ScrollView
 from kivy.uix.boxlayout import BoxLayout
 from kivy.uix.gridlayout import GridLayout
@@ -31,10 +46,10 @@
     
-
+
- # + #

Python libraries

@@ -44,10 +59,10 @@
-
+
- # + #

OS Algorithms

@@ -56,10 +71,10 @@
-
+
- # + #

OSAVA common constants and methods

@@ -68,10 +83,10 @@
-
+
- # + #

Global data for Deadlock Avoidance Algorithm

@@ -80,10 +95,10 @@
-
+
- # + #

Binder functions for Deadlock Avoidance Algorithm form

@@ -100,10 +115,10 @@
-
+
- # + #
@@ -120,10 +135,10 @@
-
+
- # + #
@@ -140,10 +155,10 @@
-
+
- # + #
@@ -160,10 +175,10 @@
-
+
- # + #
@@ -180,10 +195,10 @@
-
+
- # + #

Input Screen for Deadlock Avoidance algorithm

@@ -196,10 +211,10 @@
-
+
- # + #
@@ -210,10 +225,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -223,10 +238,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -236,10 +251,10 @@
-
+
- # + #

Called when the number of processes or number of resources input is changed (Wrapper function to allow for condition checking if required)

@@ -262,10 +277,10 @@
-
+
- # + #

If input is valid, load form else display error message

@@ -280,10 +295,10 @@
-
+
- # + #
@@ -296,10 +311,10 @@
-
+
- # + #

Initialize the global data_da dictionary

@@ -313,10 +328,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -325,10 +340,10 @@
-
+
- # + #

Add form labels for Available array (n)

@@ -342,10 +357,10 @@
-
+
- # + #

Add input fields for Available array (n)

@@ -361,10 +376,10 @@
-
+
- # + #

Max Matrix (n x m) Add form labels for resource types

@@ -379,10 +394,10 @@
-
+
- # + #

Add input fields for Max matrix (n x m)

@@ -399,10 +414,10 @@
-
+
- # + #

Allocation Matrix (n x m) Add form labels for resource types

@@ -417,10 +432,10 @@
-
+
- # + #

Add input fields for Allocation matrix (n x m)

@@ -437,10 +452,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Add labels for resource types in request form:

@@ -455,10 +470,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Add input fields for resource form

@@ -477,10 +492,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Add ScrollView

@@ -491,10 +506,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Uncomment to add buttons on scroll view

Add Visualize and back button at the end of form

@@ -508,10 +523,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -522,10 +537,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -536,10 +551,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Output screen for Deadlock Avoidance algorithm

@@ -548,10 +563,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -569,10 +584,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -589,10 +604,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Check if the request can be granted or not

@@ -603,10 +618,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Inform the user

@@ -616,10 +631,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

If request is grantable, check if the state is safe or not

@@ -633,10 +648,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

print "Request["+str(j)+"] = "+str(request[j])

@@ -683,10 +698,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Output table labels box = BoxLayout(orientation='horizontal', size_hint_x=0.6, padding=(20,0))

@@ -697,10 +712,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

box.add_widget(Label(text='Need')) box.add_widget(Label(text='Allocation'))

@@ -712,10 +727,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display initial work vector box = BoxLayout(orientation='horizontal', size_hint_x=0.6, padding=(20,0))

@@ -726,10 +741,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Need for current process box.add_widget(Label(text='-')) @@ -752,10 +767,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display step by step changes in work vector according to process scheduled

@@ -767,10 +782,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

box = BoxLayout(orientation='horizontal', size_hint_x=0.6, padding=(20,0))

@@ -780,10 +795,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Need for current process need_text = '' @@ -796,10 +811,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Allocation for current process

allocation_text = '' @@ -812,10 +827,10 @@

Allocation for current process

-
+
- # + #

Work vector after current process is allocated resources

@@ -828,10 +843,10 @@

Allocation for current process

-
+
- # + #

Finish vector after current process is allocated resources

@@ -847,10 +862,10 @@

Allocation for current process

-
+
- # + #

Show safe sequence

@@ -879,10 +894,10 @@

Allocation for current process

-
+
- # + #

Request not grantable

@@ -894,10 +909,10 @@

Allocation for current process

-
+
- # + #

Add back button box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -909,10 +924,10 @@

Allocation for current process

-
+
- # + #

Add ScrollView

@@ -923,10 +938,10 @@

Allocation for current process

-
+
- # + #
diff --git a/docs/deadlock_detection_screens.html b/docs/deadlock_detection_screens.html index 1f6faf8..22f0cf1 100644 --- a/docs/deadlock_detection_screens.html +++ b/docs/deadlock_detection_screens.html @@ -17,10 +17,25 @@
#
+ +
+
+
'''
+This file contains the classes, functions and globals used for visualizing
+Deadlock Detection algorithms
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.properties import ObjectProperty
+      
from kivy.properties import ObjectProperty
 from kivy.uix.scrollview import ScrollView
 from kivy.uix.boxlayout import BoxLayout
 from kivy.uix.gridlayout import GridLayout
@@ -31,10 +46,10 @@
     
-
+
- # + #

Python libraries

@@ -44,10 +59,10 @@
-
+
- # + #

OS Algorithms

@@ -56,10 +71,10 @@
-
+
- # + #

OSAVA common constants and methods

@@ -68,10 +83,10 @@
-
+
- # + #

Global data for Deadlock Detection Algorithm

@@ -80,10 +95,10 @@
-
+
- # + #

Binder functions for Deadlock Detection Algorithm form

@@ -100,10 +115,10 @@
-
+
- # + #
@@ -120,10 +135,10 @@
-
+
- # + #
@@ -140,10 +155,10 @@
-
+
- # + #

Input Screen for Deadlock Detection algorithm

@@ -155,10 +170,10 @@
-
+
- # + #
@@ -169,10 +184,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -182,10 +197,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -195,10 +210,10 @@
-
+
- # + #

Called when the number of processes or number of resources input is changed (Wrapper function to allow for condition checking if required)

@@ -221,10 +236,10 @@
-
+
- # + #

If input is valid, load form else display error message

@@ -239,10 +254,10 @@
-
+
- # + #
@@ -255,10 +270,10 @@
-
+
- # + #

Initialize the global data_dd dictionary

@@ -271,10 +286,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -283,10 +298,10 @@
-
+
- # + #

Add form labels for Available array (m)

@@ -300,10 +315,10 @@
-
+
- # + #

Add input fields for Available array (m)

@@ -319,10 +334,10 @@
-
+
- # + #

Allocation Matrix (n x m) Add form labels for resource types

@@ -337,10 +352,10 @@
-
+
- # + #

Add input fields for Allocation matrix (n x m)

@@ -357,10 +372,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Request Matrix (n x m) Add form labels for resource types

@@ -375,10 +390,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Add input fields for Request matrix (n x m)

@@ -395,10 +410,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Add ScrollView

@@ -409,10 +424,10 @@

Add input fields for Allocation matrix (n x m)

-
+
- # + #

Add Visualize and back button at the end of form

box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -425,10 +440,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -439,10 +454,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -453,10 +468,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Output screen for Deadlock Detection algorithm

@@ -465,10 +480,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
@@ -485,10 +500,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -501,10 +516,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Check if the system is deadlocked

@@ -515,10 +530,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Inform the user

@@ -530,10 +545,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display schedule

@@ -544,10 +559,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Output table labels box = BoxLayout(orientation='horizontal', size_hint_x=0.6, padding=(20,0))

@@ -561,10 +576,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display initial work vector box = BoxLayout(orientation='horizontal', size_hint_x=0.6, padding=(20,0))

@@ -587,10 +602,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Display step by step changes in work vector according to process scheduled

@@ -601,10 +616,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

print "Schedule["+str(i)+"] = "+str(schedule[i])

@@ -613,10 +628,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

box = BoxLayout(orientation='horizontal', size_hint_x=0.6, padding=(20,0))

@@ -639,10 +654,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Not deadlocked

@@ -666,10 +681,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add back button box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -681,10 +696,10 @@

Add Visualize and back button at the end of form

-
+
- # + #

Add ScrollView

@@ -695,10 +710,10 @@

Add Visualize and back button at the end of form

-
+
- # + #
diff --git a/docs/disk_scheduling.html b/docs/disk_scheduling.html index 04d918e..c3c9437 100644 --- a/docs/disk_scheduling.html +++ b/docs/disk_scheduling.html @@ -20,7 +20,11 @@
-
from sys import maxint
+      
'''
+This file contains the implementation of Disk Scheduling algorithms
+'''
+
+from sys import maxint
 from random import choice
diff --git a/docs/disk_screens.html b/docs/disk_screens.html index c4becc5..2ec0aff 100644 --- a/docs/disk_screens.html +++ b/docs/disk_screens.html @@ -17,10 +17,25 @@
#
+ +
+
+
'''
+This file contains the classes, functions and globals used for visualizing
+Disk Scheduling algorithms
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.core.window import Window
+      
from kivy.core.window import Window
 from kivy.graphics import Color, Line
 from kivy.properties import ObjectProperty, NumericProperty
 from kivy.uix.scrollview import ScrollView
@@ -35,10 +50,10 @@
     
-
+
- # + #

Python libraries

@@ -47,10 +62,10 @@
-
+
- # + #

OS Algorithms

@@ -59,10 +74,10 @@
-
+
- # + #

OSAVA Common constants and methods

@@ -71,10 +86,10 @@
-
+
- # + #

Global data for Disk Scheduling Algorithms

@@ -83,10 +98,10 @@
-
+
- # + #

Binder functions for Disk Scheduling Algorithms

@@ -101,10 +116,10 @@
-
+
- # + #

Input Screen for Disk Scheduling Algorithms

@@ -117,10 +132,10 @@
-
+
- # + #
@@ -133,10 +148,10 @@
-
+
- # + #
@@ -151,10 +166,10 @@
-
+
- # + #

If input is valid, load form else display error message

@@ -169,10 +184,10 @@
-
+
- # + #

Binder function for number of cylinders input

@@ -182,10 +197,10 @@
-
+
- # + #

Binder function for current position of head

@@ -195,10 +210,10 @@
-
+
- # + #

Binder function for algorithm type selection from Spinner (Dropdown)

@@ -210,10 +225,10 @@
-
+
- # + #
@@ -225,10 +240,10 @@
-
+
- # + #

Set appropriate strategy type according to the chosen algorithm by the user

@@ -257,10 +272,10 @@
-
+
- # + #

Set appropriate direction type according to the chosen algorithm

@@ -274,10 +289,10 @@
-
+
- # + #

Load the input form based on input

@@ -290,10 +305,10 @@
-
+
- # + #

Initialize the global data_disk dictionary

@@ -311,10 +326,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -325,10 +340,10 @@
-
+
- # + #

Add labels for input

@@ -339,10 +354,10 @@
-
+
- # + #

Add input

@@ -356,10 +371,10 @@
-
+
- # + #

For occypying space on right

@@ -372,10 +387,10 @@
-
+
- # + #

Box for direction spinner

@@ -399,10 +414,10 @@
-
+
- # + #

For occypying space on right

@@ -413,10 +428,10 @@
-
+
- # + #

Add ScrollView

@@ -427,10 +442,10 @@
-
+
- # + #

Add Visualize and back button at the end of form box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -443,10 +458,10 @@

-
+
- # + #
@@ -457,10 +472,10 @@
-
+
- # + #
@@ -471,10 +486,10 @@
-
+
- # + #

Output Screen for Disk Scheduling Algorithms

@@ -483,10 +498,10 @@
-
+
- # + #

Stores the memory chart generated by algorithm

@@ -495,10 +510,10 @@
-
+
- # + #

For drawing lines and arrow heads

@@ -507,10 +522,10 @@
-
+
- # + #

Left margin for output

@@ -519,10 +534,10 @@
-
+
- # + #

Increment in width per unit size

@@ -533,10 +548,10 @@
-
+
- # + #
@@ -557,10 +572,10 @@
-
+
- # + #

Generate formatted data for input to the algo

@@ -593,10 +608,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -608,10 +623,10 @@
-
+
- # + #

Inform the user

@@ -621,10 +636,10 @@
-
+
- # + #

Output the algo description

@@ -636,10 +651,10 @@
-
+
- # + #

desc_label.text_size = desc_label.size

@@ -649,10 +664,10 @@
-
+
- # + #

Draw secondary storage chart

@@ -662,10 +677,10 @@
-
+
- # + #

Add box for drawing arrows

@@ -676,10 +691,10 @@
-
+
- # + #

Add total number of cylinders traversed

@@ -690,10 +705,10 @@
-
+
- # + #

Add back button box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -705,10 +720,10 @@

-
+
- # + #

Add ScrollView

@@ -719,10 +734,10 @@
-
+
- # + #
@@ -731,10 +746,10 @@
-
+
- # + #

To add path of head

@@ -754,10 +769,10 @@
-
+
- # + #

Inserting cylinder 0 and cylinder (total number of cylinders-1) in sorted_heads to facilitate printing of the path of read/write head

@@ -769,10 +784,10 @@
-
+
- # + #

To start printing the path of read/write head from cylinder 0

@@ -787,10 +802,10 @@
-
+
- # + #

To print path of read/ write head

@@ -802,10 +817,10 @@
-
+
- # + #

To get right value of index

@@ -815,10 +830,10 @@
-
+
- # + #

print "width = {} * ({} - {})".format(self.inc, cylinder, sorted_heads[i-1])

@@ -827,10 +842,10 @@
-
+
- # + #

Alternate valign for better visibility if (i%2): @@ -849,10 +864,10 @@

-
+
- # + #

Initial height of head

@@ -879,10 +894,10 @@
-
+
- # + #
@@ -892,10 +907,10 @@
-
+
- # + #

Drawing the arrow line

@@ -907,10 +922,10 @@
-
+
- # + #

Drawing the dotted arrow line in circular algorithms

@@ -922,10 +937,10 @@
-
+
- # + #

Drawing the arrow head

@@ -935,10 +950,10 @@
-
+
- # + #

Intialising end coordinates and slope for arrow head

@@ -952,10 +967,10 @@
-
+
- # + #

Length of the arrow head on each side

@@ -964,10 +979,10 @@
-
+
- # + #

Angle of the arrow head from main line on each side

@@ -976,10 +991,10 @@
-
+
- # + #

Slope of the arrow line

@@ -996,10 +1011,10 @@
-
+
- # + #

For debugging print "x2 = {} m = {}".format(x2,m)

@@ -1009,10 +1024,10 @@
-
+
- # + #

Coordinates for right half of the head deg = self.calc_normalised_angle(m) @@ -1028,10 +1043,10 @@

-
+
- # + #

c,s = Cos and Sine of the slope angle

@@ -1043,10 +1058,10 @@
-
+
- # + #

For debugging print str(self.arrow_head_num) + "----------------------------------" @@ -1057,10 +1072,10 @@

-
+
- # + #

Coordinates for left half of the head m4 = m * cos(radians(70))#\70

@@ -1080,10 +1095,10 @@
-
+
- # + #

For debugging print "m = {}, m4 = {}, c = {}, s = {}".format(m, m4, c, s) @@ -1095,10 +1110,10 @@

-
+
- # + #

Drawing the arrow head on each side

@@ -1107,10 +1122,10 @@
-
+
- # + #

Color(0.110, 0.306, 0.643)

@@ -1121,10 +1136,10 @@
-
+
- # + #
@@ -1134,10 +1149,10 @@
-
+
- # + #
diff --git a/docs/main.html b/docs/main.html index f543c15..1a5dd94 100644 --- a/docs/main.html +++ b/docs/main.html @@ -17,10 +17,24 @@
#
+ +
+
+
'''
+This file defines the Kivy app and loads the screens and their layouts
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.app import App
+      
from kivy.app import App
 from kivy.lang import Builder
 from kivy.core.window import Window
 from kivy.uix.screenmanager import ScreenManager, Screen
@@ -28,10 +42,10 @@
     
-
+
- # + #

OSAVA screens

@@ -40,10 +54,10 @@
-
+
- # + #

Common constants and methods

@@ -54,10 +68,10 @@
-
+
- # + #

Main Menu Screen with options to choose an OS Algorithm

@@ -68,10 +82,10 @@
-
+
- # + #
@@ -86,10 +100,10 @@
-
+
- # + #

Create the screen manager and add all screens to it

@@ -111,10 +125,10 @@
-
+
- # + #

Dictionary to store which screen to navigate to when back button is pressed in android

@@ -137,10 +151,10 @@
-
+
- # + #
@@ -149,10 +163,10 @@
-
+
- # + #
@@ -163,10 +177,10 @@
-
+
- # + #
diff --git a/docs/memory_allocation.html b/docs/memory_allocation.html index 83607fa..434a9c1 100644 --- a/docs/memory_allocation.html +++ b/docs/memory_allocation.html @@ -20,7 +20,11 @@
-
from operator import itemgetter
+      
'''
+This file contains the implementation of Memory Allocation strategies
+'''
+
+from operator import itemgetter
 from copy import deepcopy
diff --git a/docs/memory_screens.html b/docs/memory_screens.html index 25c34b4..7fd7ae5 100644 --- a/docs/memory_screens.html +++ b/docs/memory_screens.html @@ -17,10 +17,25 @@
#
+ +
+
+
'''
+This file contains the classes, functions and globals used for visualizing
+Contiguous Memory Allocation Strategios
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.core.window import Window
+      
from kivy.core.window import Window
 from kivy.graphics import Color, Rectangle
 from kivy.properties import ObjectProperty, NumericProperty
 from kivy.uix.scrollview import ScrollView
@@ -34,10 +49,10 @@
     
-
+
- # + #

Python libraries

@@ -47,10 +62,10 @@
-
+
- # + #

OS Algorithms

@@ -59,10 +74,10 @@
-
+
- # + #

OSAVA common constants and methods

@@ -71,10 +86,10 @@
-
+
- # + #

Global data for Contiguous Memory Allocation Strategies

@@ -83,10 +98,10 @@
-
+
- # + #

Binder functions for Contiguous Memory Allocation Strategies form

@@ -103,10 +118,10 @@
-
+
- # + #
@@ -123,10 +138,10 @@
-
+
- # + #
@@ -143,10 +158,10 @@
-
+
- # + #

Input screen for Contiguous Memory Allocation Strategies

@@ -158,10 +173,10 @@
-
+
- # + #

Update memory size and set to default value if empty

@@ -174,10 +189,10 @@
-
+
- # + #

Set appropriate strategy type according to the chosen algorithm by the user

@@ -193,10 +208,10 @@
-
+
- # + #
@@ -208,10 +223,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -221,10 +236,10 @@
-
+
- # + #

Binder function for memory size input

@@ -234,10 +249,10 @@
-
+
- # + #
@@ -247,10 +262,10 @@
-
+
- # + #

Called when the number of processes or number of resources input is changed (Wrapper function to allow for condition checking if required)

@@ -266,10 +281,10 @@
-
+
- # + #

If input is valid, load form else display error message

@@ -284,10 +299,10 @@
-
+
- # + #

Load the input form based on input

@@ -300,10 +315,10 @@
-
+
- # + #

Initialize the global data_mem dictionary

@@ -319,10 +334,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -331,10 +346,10 @@
-
+
- # + #

Box for algo spinner box = BoxLayout(orientation='horizontal', size_hint_y=None, height='100dp', padding=(kivy.metrics.dp(5),kivy.metrics.dp(20))) @@ -351,10 +366,10 @@

-
+
- # + #

Add labels for input

@@ -368,10 +383,10 @@
-
+
- # + #

Add inputs

@@ -397,10 +412,10 @@
-
+
- # + #

Add ScrollView

@@ -411,10 +426,10 @@
-
+
- # + #

Add Visualize and back button at the end of form box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -427,10 +442,10 @@

-
+
- # + #
@@ -441,10 +456,10 @@
-
+
- # + #
@@ -455,10 +470,10 @@
-
+
- # + #

Output screen for Continuous Memory Allocation Strategies

@@ -467,10 +482,10 @@
-
+
- # + #

Stores the colours assigned to each process indexed by name

@@ -479,10 +494,10 @@
-
+
- # + #

Stores the memory chart generated by algorithm

@@ -491,10 +506,10 @@
-
+
- # + #

Margins for memory chart output

@@ -504,10 +519,10 @@
-
+
- # + #

Increment in width per unit size

@@ -516,10 +531,10 @@
-
+
- # + #
@@ -530,10 +545,10 @@
-
+
- # + #
@@ -542,10 +557,10 @@
-
+
- # + #

Generate formatted data for input to the algo and assign random colours to processes

@@ -564,10 +579,10 @@
-
+
- # + #

self.colors['hole'] = [0, 0, 0]

@@ -586,10 +601,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -598,10 +613,10 @@
-
+
- # + #

Output the algo description

@@ -619,10 +634,10 @@
-
+
- # + #

desc_label.text_size = desc_label.size

@@ -635,10 +650,10 @@
-
+
- # + #

Inform the user

@@ -648,10 +663,10 @@
-
+
- # + #

Display each element of memory chart timeline

@@ -660,10 +675,10 @@
-
+
- # + #

print str(temp_memory)

@@ -685,10 +700,10 @@
-
+
- # + #

Draw the memory state

@@ -707,10 +722,10 @@
-
+
- # + #

TODO: Better tracking of total height

@@ -721,10 +736,10 @@
-
+
- # + #

Add back button box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -736,10 +751,10 @@

-
+
- # + #

Add ScrollView

@@ -750,10 +765,10 @@
-
+
- # + #
@@ -762,10 +777,10 @@
-
+
- # + #

Unpack memory state details

@@ -774,10 +789,10 @@
-
+
- # + #

wait_queue = temp_memory['processes_waiting']

@@ -789,10 +804,10 @@
-
+
- # + #

Increment in width per unit size

@@ -801,10 +816,10 @@
-
+
- # + #

Add description labels

@@ -817,10 +832,10 @@
-
+
- # + #

Draw the memory state rectangles and add size labels

@@ -853,10 +868,10 @@
-
+
- # + #

Add size label for the end of memory

@@ -867,10 +882,10 @@
-
+
- # + #

Add the widget used to draw the meomory state on the screen

@@ -879,10 +894,10 @@
-
+
- # + #

Drawing the wait queue

@@ -950,10 +965,10 @@
-
+
- # + #
@@ -962,10 +977,10 @@
-
+
- # + #

print "Drawing {} rectangle from {} to {}".format(process_name, mem_start, rect_width)

@@ -983,10 +998,10 @@
-
+
- # + #
diff --git a/docs/page_replacement.html b/docs/page_replacement.html index 0b81763..60be523 100644 --- a/docs/page_replacement.html +++ b/docs/page_replacement.html @@ -20,7 +20,11 @@
-
from copy import deepcopy
+      
'''
+This file contains the implementation of Page Replacement algorithms
+'''
+
+from copy import deepcopy
 from sys import maxint
 from random import randint
diff --git a/docs/page_screens.html b/docs/page_screens.html index 0b0bc88..f9439d1 100644 --- a/docs/page_screens.html +++ b/docs/page_screens.html @@ -17,10 +17,25 @@
#
+ +
+
+
'''
+This file contains the classes, functions and globals used for visualizing
+Page Replacement algorithms
+'''
+
+
+
+
+
+
+ # +

Kivy libraries

-
from kivy.core.window import Window
+      
from kivy.core.window import Window
 from kivy.properties import ObjectProperty, NumericProperty
 from kivy.uix.scrollview import ScrollView
 from kivy.uix.boxlayout import BoxLayout
@@ -32,10 +47,10 @@
     
-
+
- # + #

Python libraries

@@ -44,10 +59,10 @@
-
+
- # + #

OS Algorithms

@@ -56,10 +71,10 @@
-
+
- # + #

OSAVA common constants and methods

@@ -68,10 +83,10 @@
-
+
- # + #

Global data for Page Replacement Algorithms

@@ -80,10 +95,10 @@
-
+
- # + #

Binder functions for Page Replacement Algorithm form

@@ -98,10 +113,10 @@
-
+
- # + #
@@ -116,10 +131,10 @@
-
+
- # + #

Input screen for Page Replacement Algorithms

@@ -131,10 +146,10 @@
-
+
- # + #
@@ -149,10 +164,10 @@
-
+
- # + #

If input is valid, load form else display error message

@@ -167,10 +182,10 @@
-
+
- # + #

Binder function for number of processes input

@@ -180,10 +195,10 @@
-
+
- # + #

Binder function for algorithm type selection from Spinner (Dropdown)

@@ -194,10 +209,10 @@
-
+
- # + #
@@ -208,10 +223,10 @@
-
+
- # + #

Set appropriate strategy type according to the chosen algorithm by the user

@@ -239,10 +254,10 @@
-
+
- # + #

Toggle form reload flag for this algo since we require modify bit input here

@@ -260,10 +275,10 @@
-
+
- # + #

Load the input form based on input

@@ -276,10 +291,10 @@
-
+
- # + #

Initialize the global data_page dictionary

@@ -297,10 +312,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -309,10 +324,10 @@
-
+
- # + #

Box for algo spinner box = BoxLayout(orientation='horizontal', size_hint_y=None, height='100dp', padding=(kivy.metrics.dp(5),kivy.metrics.dp(20))) @@ -329,10 +344,10 @@

-
+
- # + #

Add label for input

@@ -343,10 +358,10 @@
-
+
- # + #

Add input

@@ -360,10 +375,10 @@
-
+
- # + #

For occypying space on right

@@ -374,10 +389,10 @@
-
+
- # + #

Modify bit for enhanced second chance algo

@@ -387,10 +402,10 @@
-
+
- # + #

Add label for input

@@ -401,10 +416,10 @@
-
+
- # + #

Add input

@@ -418,10 +433,10 @@
-
+
- # + #

For occypying space on right

@@ -432,10 +447,10 @@
-
+
- # + #

Add ScrollView

@@ -446,10 +461,10 @@
-
+
- # + #

Add Visualize and back button at the end of form box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -462,10 +477,10 @@

-
+
- # + #
@@ -476,10 +491,10 @@
-
+
- # + #
@@ -490,10 +505,10 @@
-
+
- # + #

Output screen for Page Replacement Algorithms

@@ -502,10 +517,10 @@
-
+
- # + #

Stores the memory chart generated by algorithm

@@ -514,10 +529,10 @@
-
+
- # + #

Margins for memory chart output

@@ -527,10 +542,10 @@
-
+
- # + #

Width of frame box

@@ -539,10 +554,10 @@
-
+
- # + #

Increment in width per unit size

@@ -551,10 +566,10 @@
-
+
- # + #
@@ -577,10 +592,10 @@
-
+
- # + #

Generate formatted data for input to the algo

@@ -615,10 +630,10 @@
-
+
- # + #

Make sure the height is such that there is something to scroll.

@@ -631,10 +646,10 @@
-
+
- # + #

Inform the user

@@ -644,10 +659,10 @@
-
+
- # + #

Output the algo description

@@ -658,10 +673,10 @@
-
+
- # + #

desc_label.text_size = desc_label.size

@@ -671,10 +686,10 @@
-
+
- # + #

To add frame labels

@@ -698,10 +713,10 @@
-
+
- # + #

Add page referenced label

@@ -717,10 +732,10 @@
-
+
- # + #

Draw the memory chart

@@ -735,10 +750,10 @@
-
+
- # + #

Add total number of page faults

@@ -750,10 +765,10 @@
-
+
- # + #

Add page fault ratio

@@ -766,10 +781,10 @@
-
+
- # + #

Add back button box = BoxLayout(orientation='horizontal', size_hint_y=None, height=form_row_height, padding=(0, kivy.metrics.dp(5))) @@ -781,10 +796,10 @@

-
+
- # + #

Add ScrollView

@@ -795,10 +810,10 @@
-
+
- # + #
@@ -829,10 +844,10 @@
-
+
- # + #

To add page fault (Y/N)

@@ -855,10 +870,10 @@
-
+
- # + #