Question: Please Use java to write code 2. Simulator The input of the simulator is a file describing a workload. The file should have the structure

Please Use java to write code 2. Simulator The input of the simulator is a file describing a workload. The file should have the structure In this project you will simulate a multilevel feedback queue scheduling algorithm and report some performance measures on randomly generated workloads. This assignment is for groups of 2 students. described in the previous section and tan be either randomly generated or given by the user. The project consists of two parts: workload generator, and the simulator. The requirements for each part are as follows: You need to simulate a multilevel feedback queve scheduling algorithm with 4 queves: 1. Workload Generator - Quevelt1: Round Robin (RR) with time quantum q q. - Quevetz2: Round Robin (RR) with time quantum q2. - QueveH3: Shortest-remaining-time first. - Quevell4: FCFS This part generates a random workload and saves it to a file. The output file should have the following structure The user should be able to specify the value of qLq2 and that is used to predict the duration of next CPU burst for the shortest-remaining-time first algorithm. A new job enters Queuell, if it does not finish its CPU burst within 10 time-quanta, it is moved to Queve.22. Any job in Quevenz should receive at max 10 time-quanta to finish its current CPU burst, if it does not finish, it is moved to Quevett3. Jobs in Queue 3 are scheduled using the shortest-remaining-time first algorithm. If a process is preempted 3 times by other process entering Quevett3, it is moved to Queuett4 where it Each line in the file represents a process with a unique PID. All other numbers should be randomly generated from a range that is specified by the user. The generator should take the following parameters to generate the workload: is scheduled using FCFS algorithm. - Number of processes: an integer value that specifies the number of generated Queueft 1 is considered the highest priority and Queuet4 is the lowest. The scheduler first processes. evecutes all processes in QueveH1. Only when Queve"1 is empty will it execute processes in - Max arrival time: an integer value specifies the maximum arrival time. The arrival time of the processes should be randomly chosen from the interval [0, Max arrival time]. Queuet2. A process that arrives for Queuett 2 will preempt a process in Queuett3. A process in Queuent2 will in turn be preempted by a process arriving for Queuet1. - Max No. of CPU Burst: an integer value that speclfles the max number of CPU bursts for any process. The number of CPU burst for each process should be randomly generated from the range [1, Max No. CPU Burst]. Between the CPU burst you should insert IO bursts. However, note that the first and last bursts in any process must be CPU Burst. Assume that the context switch time is very small and can be ignored in the simulation. [Min 10, Max 10]: The range for the 10 burst duration, which should be randomly generated. When a process firishes its current CPU burst, it moves to 10 and starts consuming its 10 [Min CPU, Max CPU]: The range for the CPU burst duration, which should be randomly burst. Assume that processes do not wait for each other and they can perform 10 generated. The generated workload should be saved to a file, which can be then used as input for the simultaneously. When the 10 burst is finished, the process goes back to the queue from which it requested the last 10 burst (the last queve that the process was assigned to). simulator. The user should be able to pause the simulation at any time and view the list of processes in each queue, the currently running process, and the processes performing 10 . At the end of the simulation, you should output the Gantt chart, CPU utlization, and the average waiting time for all the processes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
