-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSRTF.h
37 lines (29 loc) · 826 Bytes
/
SRTF.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
AUTHORS: Alex Runciman
FILEFAME: FCFS.h
DESCRIPTION: This class is designed to run a SRTF simulator and print the
results for the average wait time, average response time, average
turn around time, and the cpu usage.
*/
#ifndef SRTF_H
#define SRTF_H
#include "scheduler.h"
#include <vector>
class SRTF: public virtual Scheduler {
public:
SRTF(string input) : Scheduler(input){};
~SRTF(){};
void runScheduler();
protected:
// Returns the average response time
double avgRespQuery();
// Returns the average wait time
double avgWaitQuery();
// Returns the average turnaround time
double avgTurnaroundQuery();
// Returns the CPU usage in percentage form
double cpuUseQuery();
private:
static const int MAX = 1000000;
};
#endif