-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimulator.h
46 lines (38 loc) · 1.18 KB
/
Simulator.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
#ifndef Simulator_H_
#define Simulator_H_
#include <string>
#include <vector>
#include "HashPageTable.h"
#include "LRU.h"
#include "SecondChance.h"
#include "Statistics.h"
class Simulator {
private:
HPT_P1* hpt_p1;
HPT_P2* hpt_p2;
int frames;
int frameSize;
int quantum;
int maxReferences;
std::string replacementAlg;
LRU* lru;
SecondChance* sca;
int processId;
Stats statistics;
// int* Memory;
public:
Simulator(std::string replacementAlg, int frames, int frameSize, int quantum, int maxReferences);
~Simulator();
void run();
void runLRU(Address& address);
void runSC(Address& adrress);
void checkDirty(Address& address);
Address* getTrace(std::ifstream& trace1, std::ifstream& trace2);
void swapProcess();
void swapTrace(std::istream** currtrace, std::ifstream& trace1, std::ifstream& trace2);
void init_Stats();
void printStatistics();
// void printRequest(Address* address);
// void printMemory(Address* address, Address* victim, int pf); //print page faults, disk writes/read
};
#endif