Skip to content

Commit

Permalink
Adjust some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hernandesmacedo committed Dec 2, 2021
1 parent c3765e4 commit 65a49c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class OS:
and in the last list index will be the Queue of processes with lowest priority.
"""
def __init__(self):
"""Initiate a new OS with no processes Queue."""
"""Initiate a new Operating system with no processes Queue."""
self.sorted_queues = []

def __repr__(self):
Expand Down Expand Up @@ -121,7 +121,7 @@ def new_position_in_sorted_queues(self, priority):
`priority`: priority of the new Queue
Returns:
The position (index) where the new Queue must be inserted based in its `priority` value,
The position (index) where the new Queue must be inserted based on its `priority` value,
in order to maintain the priority rule.
"""
for queue in self.sorted_queues:
Expand All @@ -132,7 +132,7 @@ def new_position_in_sorted_queues(self, priority):
def add_process(self, process):
"""
Receives a new PCB process and verifies if there is a Queue with same priority in OS.
If not, creates a new Queue and insert it in a position based in process
If not, creates a new Queue and insert it in a position based on process
`priority` value, to maintain the priority rule.
If already exists a Queue with same priority in OS, then just adds it to the end of this Queue.
Expand All @@ -159,11 +159,11 @@ def context_switch(self, queue, running_process, time_unit):
"""
This method executes the Context Switch.
If the running process still has remaining time to be finished, then points to the next
process as the first in Queue, logs a message of Stopped process, Quantum endend and Context Switch event.
process as the first in Queue, logs a message of Stopped process, Quantum ended and Context Switch event.
If the running process does not have remaining time to be finished, this means it has already been finished,
then points to the next process as the first in Queue, deletes the finished process memory space, decreases the
Queue length by 1, and logs a message of Endend process, Quantum endend and Context Switch event.
Queue length by 1, and logs a message of Ended process, Quantum ended and Context Switch event.
Args:
`self`: Scheduler
Expand All @@ -186,7 +186,7 @@ def context_switch(self, queue, running_process, time_unit):
else:
logging.info("TIME {:03d} | QUANTUM ENDED".format(time_unit))
else:
logging.info("TIME {:03d} | Endend ".format(time_unit) + str(running_process))
logging.info("TIME {:03d} | Ended ".format(time_unit) + str(running_process))
if queue.length > 1:
logging.info("TIME {:03d} | QUANTUM ENDED | CONTEXT SWITCH".format(time_unit))
else:
Expand Down

0 comments on commit 65a49c3

Please sign in to comment.