Implement 3 scheduling algorithms, FIFO, SJF, SRT based onfollowing actions:
The simulation maintains the current time, t, which isinitialized to 0 and is incremented after each simulation step.Each simulation step then consists of the following actions:
repeat until Rรกยตยข == 0 for all n processes /* repeat until allprocesses have terminated */
while no process is active, increment t /* if no process is readyto run, just advance t */
choose active processes pรกยตยข to run next
according to scheduling algorithm /* Ex: FIFO, SJF, SRT */
decrement Rรกยตยข /* pรกยตยข has accumulated 1 CPU time unit */
if Rรกยตยข == 0 /* process i has terminated */
set active flag of pรกยตยข = 0 /* process i is excluded from furtherconsideration */
TTรกยตยข = t - Aรกยตยข /* the turnaround time of process i is the time
since arrival, TTรกยตยข, until the current time t */
compute the average turnaround time,
ATT, by averaging all values TTรกยตยข