Question: ( This Must be in JAVA ) Purpose: Write a program to implement deterministic evaluation of CPU scheduling algorithms with the average waiting time criterion.
This Must be in JAVA
Purpose: Write a program to implement deterministic evaluation of CPU scheduling algorithms
with the average waiting time criterion.
Scheduler Sanpshot: Initial ready queue has processes where each process has the following
attributes:
i an identifier value between and randomly assigned however, no two processes
can have the same id
ii a burst length between randomly assigned when the process is created
iii a priority between and low value indicates higher priority randomly assigned
when the process is created two or more processes may have same priority rank
Requirement : Display initial snapshot of the system with the information of above processes as
following tabular manner order the entries in increasing ID number:
Process ID Priority Burstlength
RUBRIC: Correct values within the range ID burst length, priority
Nonduplicate ID
Display of the initial snapshot correct tabular format
Requirement : Now, allow user of the program to enter attributes id priority, and burst length of
another process the one Make sure the following are satisfied:
i user may enter any integer as a process ID Your program must check the appropriate
range to Also, user entered value should not be a duplicate of already created IDs.
Any of these violated, user must be notified and given chances to enter a valid ID
ii User may enter any integer as burst length. Your program must check the appropriate
range to If violated, user gets chances until an acceptable value is entered.
iii User may enter any integer as a priority value. Your program must check the appropriate
range to If violated, user gets chances until an acceptable value is entered.
Display updated snapshot of the system with processes now in the same format as above
Requirement
RUBRIC: Correct input acceptance implementation
Requirement :
Now, assuming all processes are ready for scheduling, calculate individual waiting time for each
process using the following algorithms: i Nonpreemptive priority, and ii round robin with time
quantum
Display the result as follows in tabular form:
Process ID Priority Burstlength Scheduling algorithm Waiting time
The above snapshot display should be grouped by algorithm. That is results from priority algorithm
followed by results from RR algorithm. For priority algorithm, results should display the records by
priority rank of the processes. For equal priority, choose the process with lower ID value. The round
robin algorithm should consider the processes in their ID order lowest to highest The display of
the result should also be in the ID order.
RUBRIC: Correct format, with ordering
Correct implementation of the priority algorithm tested by correct waiting time
values
Correct implementation of the RR algorithm tested by correct waiting time values
Requirement : Based on your snapshot and calculations, also display average waiting time for
each algorithm.
RUBRIC: Correct average waiting time values
Hints:
You can consider this coding as an implementation of Gnatt chart to calculate average
waiting time.
You do not need to create any actual process that is no need to use fork Treat a process
as an object that has some attributes like ID burst length, priority, etc. You may add other
attributes as you deem necessary.
You can work with absolute values ignoring the time unit. That is a process may have burst
length you can ignore whether it is seconds or milliseconds.
The RR scheduler selects the processes according to ID order lowest to highest The
priority scheduler selects the processes with highest priority first.
This program does not need multithreading. Simple data structures arrays lists, etc. should
be sufficient to implement the scheduling algorithms.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
