-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathExecution.h
60 lines (43 loc) · 1.54 KB
/
Execution.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef EXECUTION_H
#define EXECUTION_H
#include "Process.h"
#include "Command.h"
#include "FileParser.h"
#include <vector>
#include <iostream>
using namespace std;
class Execution{
public:
Execution();
~Execution();
void execute(string inputCommand);
private:
Process process;
Command command;
FileParser fileParser;
vector<int> vectorCPUBound;
ofstream resultsFile;
int startTime, currentTime = 0, remainingDeadline, remainingExecutionTime, partiallyExecutedTime, requiredCPUTime;
int nextAvailableProc, nextAvailableProcTime = 0, nextAvialableProcBurstTime, nextAvailableProcDeadline = 0;
int currentRunningProc, currentRunningProcDeadline, currentRunningProcPosition, currentRunningProcBurstTime;
float nextAvailableProcPriority, currentRunningProcPriority;
bool preEmpted = false, ganttPass = true, missingProcDuplicate = false;
//Execute Rate Monotonic Algorithm
void rateMonotonic(Process process);
void rateMonotonicAlg(Process process);
//Execute Earliest Deadline First Algorithm
void earlyDeadline(Process process);
void earlyDeadlineAlg(Process process);
//Execute Deadline Monotonic Algorithm
void deadlineMono(Process process);
void deadlineMonoAlg(Process process);
void minimalView(Process process);
void verboseView(Process process);
void detailedView(Process process);
void initialiseResultsFile();
void checkIdle();
void report(Process process);
void resetVariable();
void removeFromCPUBound(int procPos);
};
#endif