Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Simulate two CPU scheduling algorithms. FCFS (Code template provided and explained in the class) S.JF Make necessary changes to FCFS to implement this] You must
Simulate two CPU scheduling algorithms. FCFS (Code template provided and explained in the class) S.JF Make necessary changes to FCFS to implement this] You must use the template provided in the class. To understand how to meet the requirements slated below. Required outputs for each algorithm: . During the simulation (run for 100 time units): If any process is running print the process id and global time at each timestamo. If no process is running print the global time and mention that no process is ready . At the end of the simulation Print wating time (WT), completion time (CT) and turnaround time (TAT) for each process. Print average waiting time and average turnaround time. o For this task you can implement additional variables imathods in any class Prepare a text file (output.txt) with your output Ines. You can do this by simply copying the console Output to a text file. Otherwise, you can use lava File 10 to do . Follow this Ink for reference Java Create and Write To Files. Submit the text file along with your source codes 1. I. dll ww 11: - WIF VA IND 2 that wird Arirar at Center cil al Y4/ blow! WA ar lir lili the trump !!! Title wir . . 1 package schedulingos: public class Process I 4 st lui tat arrivattire: 6 at duration: 7 GlobalTimer luliwr pubite Proxectnt 1d, in arrival Tire, int duration, Global Tirer globalTimer 9 this.td-ldi 10 the arrivalleiveltime 13 this.duration duratan 12 this.globaliralobalu: 13 ) 14 public voulu 15 // TASK: Kette your core tere 10 1 The process Ntll artist's ld and ytebut tia for the duration Selfie by burnt tu 17 10 19 . public int petid) 20 reture : 23 + 72 public int tartvaline) 23 return arrivati 24 1 25 public int gethuration() { 26 return ouration: 27 1 puble lahter getGohelimet 29 return plobalter 30 1 31 1 package schedulingos; 2 3 public class GlobalTimer { 4 int time; 5 public GlobalTimer (int initialTime) { 6 this.timerinitialTime; 7 } 8} Simulate two CPU scheduling algorithms. FCFS (Code template provided and explained in the class) S.JF Make necessary changes to FCFS to implement this] You must use the template provided in the class. To understand how to meet the requirements slated below. Required outputs for each algorithm: . During the simulation (run for 100 time units): If any process is running print the process id and global time at each timestamo. If no process is running print the global time and mention that no process is ready . At the end of the simulation Print wating time (WT), completion time (CT) and turnaround time (TAT) for each process. Print average waiting time and average turnaround time. o For this task you can implement additional variables imathods in any class Prepare a text file (output.txt) with your output Ines. You can do this by simply copying the console Output to a text file. Otherwise, you can use lava File 10 to do . Follow this Ink for reference Java Create and Write To Files. Submit the text file along with your source codes 1. I. dll ww 11: - WIF VA IND 2 that wird Arirar at Center cil al Y4/ blow! WA ar lir lili the trump !!! Title wir . . 1 package schedulingos: public class Process I 4 st lui tat arrivattire: 6 at duration: 7 GlobalTimer luliwr pubite Proxectnt 1d, in arrival Tire, int duration, Global Tirer globalTimer 9 this.td-ldi 10 the arrivalleiveltime 13 this.duration duratan 12 this.globaliralobalu: 13 ) 14 public voulu 15 // TASK: Kette your core tere 10 1 The process Ntll artist's ld and ytebut tia for the duration Selfie by burnt tu 17 10 19 . public int petid) 20 reture : 23 + 72 public int tartvaline) 23 return arrivati 24 1 25 public int gethuration() { 26 return ouration: 27 1 puble lahter getGohelimet 29 return plobalter 30 1 31 1 package schedulingos; 2 3 public class GlobalTimer { 4 int time; 5 public GlobalTimer (int initialTime) { 6 this.timerinitialTime; 7 } 8}
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