Question
In this project, we are going to simulate Round-Robin Scheduling Algorithm Developing tools: NetBeans in Windows. General Description: Assume we have 10 processes that need
In this project, we are going to simulate Round-Robin Scheduling Algorithm
Developing tools:
NetBeans in Windows.
General Description:
Assume we have 10 processes that need to be run. Each process needs 4 to 40 ms cpu time (a random number), and each process arrives at ready queue within the first 8 ms. Write a program that simulate RR scheduling. The time quantum should be specified by user and it should be within the range of 2 20 ms. Context switching takes 0ms n this simulation. At the end of simulation, your program should output following fields for each process:
Proc # Initial enqueuer Time CPU time End time Total time
Developing procedure:
1-Get IDE ready.
2-Learn how to use Java LinkedList as a queue. Also, we will need to use ArrayList to store created process.
3-Create a class for Process. It should have at least three fields: arrival time, cpu time and exec time.
4-Create a 10 process objects and place them into an ArrayList. For each process object, arrival_time, cpu_time we are assigned with different random number.
5-Write a loop that mimics the clock. It starts with 0 and ends when there are no more processes.
6-On the finish of each process, print out the required information.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started