-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDemandPagingEAT.java
More file actions
21 lines (19 loc) · 805 Bytes
/
DemandPagingEAT.java
File metadata and controls
21 lines (19 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class DemandPagingEAT{
static double pageFaultProb = 0.5;
static double memoryAccess = 200;
static double pageFaultTime = 8000000;
//set true if pageFaultTime needs to be caluclated automatically therefore all the values below should be intialised
static boolean calculatePFT = false;
//initialise the values
static double pfOverhead = 0;
static double swapPageOut = 0;
static double swapPageIn = 0;
static double restartOverhead = 0;
public static void main(String[] args){
if(calculatePFT){
pageFaultTime = pfOverhead+swapPageOut+swapPageIn+restartOverhead;
}
double result = ((1-pageFaultProb)*memoryAccess)+(pageFaultProb*pageFaultTime);
System.out.println("Demand paging EAT = "+result);
}
}