This packing to get result of process by using various cpu scheduling algorithm
#right only js and ts are supported
npm i cpuschedulerts
- FCFS, First come first serverd
- SJF, Shortest Job First
- NPP, non-Preemptive Priority
- HRN, Highest Response-ratio Next
- PP, Preemptive Priority
- RR, Round Robin
- SRT, Shortest Remaining Time
// declaration
fcfs()
//eg
const FCFS = new fcfs();
FCFS.simulate(processArray)
// declaration
sjf()
//eg
const SJF = new sjf();
SJF.simulate(processArray)
// declaration
staticPriority()
//eg
const StaticPriority = new staticPriority();
StaticPriority.simulate(processArray)
// declaration
hrn()
//eg
const HRN = new hrn();
HRN.simulate(processArray)
// declaration
dynamicPriority()
//eg
const DynamicPriority = new dynamicPriority();
DynamicPriority.simulate(processArray)
// declaration
rr(timeQuantum:number)
//eg
const RR = new rr(3);
RR.simulate(processArray)
// declaration
srt(timeQuantum:number)
//eg
const SRT = new srt(10);
SRT.simulate(processArray)
methods | define:return | description |
---|---|---|
getResult | [class].getResult():Process[] | get a Array of result PCB |
simulate | [class].simulate():void | to simulate corresponding cpu scheduling simulator |
getAverageWaitingTime | [class].getAverageWaitingTime():number | get a AWT of corresponding simulator |
getAverageTurnaroundTime | [class].getAverageTurnaroundTime():number | get a ATT of corresponding simulator |
createProcess | createProcess(pid:number,brustTime:number,arrivalTime:number,priority:number):process | create a Process |