-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (24 loc) · 846 Bytes
/
main.cpp
File metadata and controls
27 lines (24 loc) · 846 Bytes
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
#include "InputManager.h"
#include "Scheduler.h"
#include "RTScheduler.h"
using namespace std;
int main() {
InputManager input;
input.getInput();
if(input.getAlgorithmType() == 0) {
Scheduler* scheduler = new Scheduler(input.getTimeQuantum(), input.getProcesses(), input.getNumQueues(),
input.getAgeing(), input.getMinArrival());
if (input.getHandleIO()) {
scheduler->setHandleIO(input.getHandleIO());
scheduler->setIoOffset(input.getIO_Offset());
}
scheduler->runMFQS();
free(scheduler);
} else {
bool hard = input.getRealTimeType() == 1;
RTScheduler* scheduler = new RTScheduler(input.getProcesses(), hard, input.getMinArrival());
scheduler->run();
free(scheduler);
}
return 0;
};