-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
25 lines (20 loc) · 701 Bytes
/
main.cpp
File metadata and controls
25 lines (20 loc) · 701 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
#include <iostream>
#include "src/processService.hpp"
#include <vector>
#include "src/processLog.hpp"
#include "src/cfs.hpp"
#include <fstream>
int main(int argv, char* argc[]) {
std::vector<Process*> processes = getProcessFromJson("../resources/process.json");
cfs scheduler;
std::vector<ProcessLog*> logs = scheduler.schedule(processes);
std::ofstream outFile("../process_schedule.csv");
outFile << "pid,start_time,end_time" << std::endl;
for(auto processLog: logs) {
outFile << processLog->pid << ","
<< processLog->startTime << ","
<< processLog->endTime << std::endl;
}
outFile.close();
return 0;
}