Computers and Technology

FOLLOW INSTRUCTIONS BELOW , WRITTEN IN JAVA LANGUAGE PLEASE AND THANK YOU ! Project Descriptions
This project involves implementing two process scheduling algorithms. You will be
required to write a Java program to simulate FCFS and RR scheduling policies we
discussed in class. The simulator selects a task to run from a ready queue based on the
scheduling algorithm. Since the project intends to simulate a CPU scheduler, it does not
require any actual process creation or execution. The processes’ information is stored in a
text file.
When a task(process) is scheduled, the simulator will simply print out what task is
selected to run at a time. I have provided a sample run below.
The name of your Java program should be called CPUScheduler. java
The selected scheduling algorithms to implement in this project are:
Round Robin (RR)
First Come First Serve (FCSF)
The above algorithms are already described in class slides, class video recordings and
textbook Chapter 5.
Implementation
The implementation of this project should be completed in Java. Your program will read
information about processes from a text file. This supporting text file contains process
scheduling information such as the pid, arrival time and CPU burst time. Your program
should read in this information, insert the processes into a list, and invoke the scheduler.
Process information
The following example format of how your text file should look like:
P1 0 10
P2 1 8

P3 2 5
The first column represents a process ID. Process ID uniquely identifies a process.
The second column represents arrival time. This is the time when the process arrives
in the unit of milliseconds
The third column represents CPU burst. This is the CPU time requested by a time, in
the unit of milliseconds
Thus, P1 arrives at 0 and has a CPU burst of 10 milliseconds and so forth.
The program will be run from the command line where you provide the name of the file
where the processes are stored.
The simulator first reads task information from the input file and stores all data in a data
structure. Then it starts simulating one scheduling algorithm in a time-driven manner. At
each time unit (or slot), it adds any newly arrived task(s) into the ready queue and calls a
specific scheduler algorithm in order to select appropriate tasks from the ready queue.
When a task is chosen to run, the simulator prints out a message indicating what process
ID is chosen to execute for this time slot. If no task is running (i. e. empty ready queue), it
prints out an "idle" message. Before advancing to the next time unit, the simulator should
update all necessary changes in task and ready queue status.

Grading
110 Total points possible
5 follows good coding practices
5 Runs from the command line
10 Reads the processes from a text file
10 Program compiles successfully and runs
40 FCFS produces the correct output
40 RR produces the correct output
Good coding practices:
Your code must:
be commented
use meaningful variable, method, and class names
use proper indenting
use objects, as well as static and non-static variables and methods, properly
be readable
Sample Execution
Assume that you have created a file process. txt with the following data:
P0 0 3
P1 1 6
P2 5 4
P3 7 3

If you invoke your scheduler (executable CPUScheduler) using the command
java CPUScheduler process. txt 2
Note that in the above command, process. txt is the name of the file to
read from and 2 is the time slide for RR
then your program should have a behavior similar to the following:


CPU Scheduling Simulation



First Come First Served Scheduling

[0-3] P0 running
[3-9] P1 running
[9-13] P2 running
[13-16] P3 running
Turnaround times:
P0 = 3
P1 = 8
P2 = 8
P3 = 9
Wait times:
P0 = 0
P1 = 2
P2 = 4
P3 = 6
Response times:
P0 = 0
P1 = 2
P2 = 4
P3 = 6
Average turnaround time: 7.00
Average wait time: 3.00
Average response time: 3.00


Round Robin Scheduling

[0-2] P0 running
[2-4] P1 running
[4-5] P0 running
[5-7] P1 running

[7-9] P2 running
[9-11] P3 running
[11-13] P1 running
[13-15] P2 running
[15-16] P3 running
Turnaround times:
P0 = 5
P1 = 12
P2 = 10
P3 = 9
Wait times:
P0 = 2
P1 = 6
P2 = 6
P3 = 6
Response times:
P0 = 0
P1 = 1
P2 = 2
P3 = 2
Average turnaround time: 9.00
Average wait time: 5.00
Average Response time: 1.25

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:30, skywil8981
Step 1: choose your topics review the project milestone reflections you submitted for modules 1 through 4. choose the one major idea or concept from each module that you feel most applies to your life. in addition, choose an important concept from module 5 that applies to your life. step 2: write your guidebook for each module: write a catchy headline that clearly and concisely sums up your chosen idea or concept write a brief explanation that includes a description of the concept, why it is important, and how it can be applied to your life to make a positive impact choose an exciting, powerful, or engaging image that illustrates your concept remember, you are writing one for each module, so you will have a total of five headlines, five descriptions, and five images. step 3: design your guidebook choose a format to present your digital guidebook. there are many 21st century tools available for creating and submitting your work in the online environment. for more information on tools your school uses, contact your instructor or visit the web 2.0 tools area.
Answers: 3
image
Computers and Technology, 23.06.2019 13:50, mrfishyyyy
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, evanwall91
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
image
Computers and Technology, 24.06.2019 02:00, arubright177
Write an expression that will cause the following code to print "equal" if the value of sensorreading is "close enough" to targetvalue. otherwise, print "not equal". ex: if targetvalue is 0.3333 and sensorreading is (1.0/3.0), output is:
Answers: 1
Do you know the correct answer?
FOLLOW INSTRUCTIONS BELOW , WRITTEN IN JAVA LANGUAGE PLEASE AND THANK YOU ! Project Descriptions

Questions in other subjects: