You are required to create a CPU Scheduler Simulator written in Python to schedule the provided dataset (the spreadsheet below) according to the four Scheduling Algorithms discussed in Week 2 tutorial activities.
The spreadsheet your Python Scripts must read is here. [attached xlsx]
When simulating the Round Robin algorithm, you must use Quantum = 3 TUs. RR is also subject to an overhead of 1 TU each time a context switch occurs, the same as explained in Tutorial 2 and illustrated in Lecture 5.
- Priority Scheduling. PRI
- Round Robin Scheduling. RR
As illustrated in the tutorial, there can be situations where it is not clear which process should be next to use the CPU. For example, if two processes arrive at the same time having the same priority when scheduling based on priority. For those situations, a fallback algorithm must be chosen. FIFO and SJF are both good as a fallback and both could be considered good choices, but in order to keep all submissions under the same parameters, let’s agree that:
- If by any chance when scheduling Priority two or more processes are ready to be selected, the scheduler must fall back to FIFO.
- If by any chance when scheduling Round Robin two or more processes are ready to be selected, the scheduler must fall back to SJF.
Resources you should refer to:
- The Dinosaur’s book, if possible.
- Week 2’s Lecture handouts, especially Lecture 5.
- Week 2’s Tutorial, especially the CPU Scheduling section.
• The output of your simulator must be similar to the one we have been seeing in the Week 2 Tutorial.
This is an example of how the output of your scripts should look like:
Time Unit 1: PID 1 executes. 5 instructions left. Q=3.
PID 2 wait=1.
Time Unit 2: PID 1 executes. 4 instructions left. Q=2.
PID 2 wait=2. PID 3 wait=1.
Time Unit 3: PID 1 executes. 3 instructions left. Q=1.
PID 2 wait=3. PID 3 wait=2.
Time Unit 4: PID 1 executes. 2 instructions left. Q=0.
PID 2 wait=4. PID 3 wait=3.
Time Unit 5: Context switch. PID 2 wait=5.
PID 3 wait=4. PID 1 wait=1.
issuing python filename.py.
These are the questions the assessor will have in mind when assessing your submission:
- Does the CPU scheduler generate the expected output for each algorithm for a given set of test data?
- Does it look like the students submitted an authentic implementation?
- Does it work when I run it?
nnet form. This is since “Shakespeare uses nothing but the Shakespearean form, but for the most part uses it straight.” (Barber 654). The Shakespearean sonnet consists of an octave rhyming ababcdcd and a sestet containing a rhyming couplet efef gg. However, I wish to claim that there is not only a single form of the English sonnet and subjugating every such sonnet under the term Shakespearean might seem parochial since I do agree with Ordemann who states, “that the sonnet as a form “the most rigid,” is actually very flexible” (172). He both rationally and, to me, in a humorous manner points out that “it can be shown that 51,300 possible arrangements are possible without destroying the sonnet as a recognizable form. With such multitude of possible variations, the sonnet form should not prove much of a barrier to any real poet’s expression.” (173). However, on an earlier occasion, he states, “that the total possible arrangements of in what legitimately might be called the Elizabethan sonnet are 55” (172). According to this, there are 55 rhyme schemes with a rhyming couplet and distinctive alternating rhyming patterns to the octave and sestet, the main characteristic of Elizabethan sonnets. Thus, the Shakespearean form is only just one of these. Breaking the sonnet form thus is either a deliberate and perhaps vigorous act or lack of knowledge of the sonnet itself. In this following paragraph, I want to engage with the understanding of the sonnet form and its implementation in Shakespeare’s sonnet 130. A sonnet, by Oppenheimer, is understood as “a single stanza poem, albeit a stanza with a twist, a sudden turn of thought, an abrupt transformation of theme at the middle, at line nine” (Holton 378). A brief look at the sonnet reveals that it indeed consists of 14 lines and that the rhyming pattern points towards three cross-rhymed quatrains with a rhyming couplet at the end of the sestet. After reading the poem for the first time the reader might come to the conclusion that this sonnet seems to insult the addressee on every occasion. But giving it a more detailed look upon the context it was written in, helps to clear the doubts and “false compare” (Sonnet 130 line 14). A plethora of sonnets of that time had love as their predominant theme – overidealizing representation of loved ones, using rich Petrarchan imagery in hyperbolic ways to captivate their addressees. These sonnets were referred to as Blazons, a device that Petrarch himself made popular and which was carried on in Elizabethan works. Sonnet 130, in fact, is written as a Blazon, however, does ironically describe the Dark Lady using Anti-Petrarchan imagery to point out its overuse.>GET ANSWER