|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--Strategie.ReplaceStrategy
|
+--Strategie.NRU
Implementation of the page replacement strategy NRU (Not-recently-used). It is based on Clock and there on FIFO. In addition to Clock, a modifyBit is used, to prefer selecting pages for replacing, that have not been modified recently.
| Field Summary | |
static boolean |
ISACCESSCOUNT
Number of accesses is not relevant for this strategy. |
static boolean |
ISACCESSTIME
Time of access is not relevant for this strategy. |
static boolean |
ISINSERTIONTIME
Time of insertion is relevant for this strategy. |
static java.lang.String |
LONGNAME
Long name of this streategy. |
static int |
MODBITCOUNT
Number of reference-bits of this strategy. |
static int |
REFBITCOUNT
Number of reference-bits of this strategy. |
static java.lang.String |
SHORTNAME
Short name of this streategy. |
| Fields inherited from class Strategie.ReplaceStrategy |
isAccessCount, isAccessTime, isInsertTime, isShowMemoryDetails, longName, modifyBitCount, referenceBitCount, shortName |
| Constructor Summary | |
NRU(boolean showDetails)
Creates a new instance of this strategy. |
|
| Method Summary | |
Memory |
createMemory(int size,
int refBits,
int modBits)
Creates a new memory structure with the given size and number of reference- and modifyBits. |
int |
getDrawLfdNr(Memory memory,
int i)
Returns the index of the frame i in memory structure. |
Page |
getVictimPage(Memory memory,
SimuData simu,
GUI gui)
Selects the next victim page. |
void |
replacePage(Memory memory,
Page oldPage,
Page newPage,
SimuData simu,
GUI gui)
Replaces the oldPage by the newPage in memory. |
void |
setInitVictimPointer(Memory memory)
Sets the indexpointer to the page that has to be placed first. |
void |
sortMemory(Memory memory)
Sorts the memory by insertiontime of each page. |
| Methods inherited from class Strategie.ReplaceStrategy |
getLongName, getModifyBitCount, getReferenceBitCount, getShortName, isAccessCount, isAccessTime, isInsertTime, isModifyBit, isReferenceBit, isShowMemoryDetails, reInsertPage, setShowMemoryDetails |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final java.lang.String SHORTNAME
public static final java.lang.String LONGNAME
public static final int REFBITCOUNT
public static final int MODBITCOUNT
public static final boolean ISACCESSCOUNT
public static final boolean ISACCESSTIME
public static final boolean ISINSERTIONTIME
| Constructor Detail |
public NRU(boolean showDetails)
| Method Detail |
public Memory createMemory(int size,
int refBits,
int modBits)
createMemory in class ReplaceStrategypublic void setInitVictimPointer(Memory memory)
setInitVictimPointer in class ReplaceStrategypublic void sortMemory(Memory memory)
sortMemory in class ReplaceStrategy
public int getDrawLfdNr(Memory memory,
int i)
getDrawLfdNr in class ReplaceStrategy
public Page getVictimPage(Memory memory,
SimuData simu,
GUI gui)
getVictimPage in class ReplaceStrategy
public void replacePage(Memory memory,
Page oldPage,
Page newPage,
SimuData simu,
GUI gui)
replacePage in class ReplaceStrategy
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||