forked from marthly/Real-Time-Scheduling-Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileGeneration.h
39 lines (27 loc) · 883 Bytes
/
FileGeneration.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
#ifndef FILEGENERATION_H
#define FILEGENERATION_H
#include <iostream>
#include <fstream>
#define MAX_PROCESSES 10
using namespace std;
class FileGeneration{
public:
FileGeneration();
~FileGeneration();
//Generate file with a random number of processes
void generateInputFile(string fileName, bool isDistributed);
//Generate file with a specific number of processes
void generateInputFile(string fileName, int totalProc, bool isDistributed);
private:
ofstream outputFile;
string input, fileName;
int totalProc, procSwitch;
int procNum = 1, arrivalTime = 0, burstTime, relativeDealine, period;
void setFileName(string fileName);
void generateFile(bool isDistributed);
void setTotalProc(int totalProc);
void randomizeDist();
void randomizeNotDist();
bool fileExists(const string& name);
};
#endif