Strategie
Class OPT

java.lang.Object
  |
  +--Strategie.ReplaceStrategy
        |
        +--Strategie.OPT

public class OPT
extends ReplaceStrategy

Implementation of the page replacement strategy OPT. The victim page is the page, that hast the highest time of access in the future. It's an optimal selection!


Field Summary
private  int hits
          Number of hits.
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 not relevant for this strategy.
static java.lang.String LONGNAME
          Long name of this streategy.
private  int misses
          Number of misses.
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
OPT(boolean showDetails)
          Creates a new instance of this strategy.
 
Method Summary
 int getHits()
          Returns the number of hits in the last evalution run
 int getMisses()
          Returns the number of misses in the last evalution run
 Page getVictimPage(Memory memory, SimuData simu, GUI gui)
          Selects the next victim page.
 void performEvalutation(Memory memory, ReferenceString refString, SimuData simu, GUI gui)
          Performs a simulation to get the equivalent result with OPT in comparison to any other replace algorithm.
 
Methods inherited from class Strategie.ReplaceStrategy
createMemory, getDrawLfdNr, getLongName, getModifyBitCount, getReferenceBitCount, getShortName, isAccessCount, isAccessTime, isInsertTime, isModifyBit, isReferenceBit, isShowMemoryDetails, reInsertPage, replacePage, setInitVictimPointer, setShowMemoryDetails, sortMemory
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SHORTNAME

public static final java.lang.String SHORTNAME
Short name of this streategy.

LONGNAME

public static final java.lang.String LONGNAME
Long name of this streategy.

REFBITCOUNT

public static final int REFBITCOUNT
Number of reference-bits of this strategy.

MODBITCOUNT

public static final int MODBITCOUNT
Number of reference-bits of this strategy.

ISACCESSCOUNT

public static final boolean ISACCESSCOUNT
Number of accesses is not relevant for this strategy.

ISACCESSTIME

public static final boolean ISACCESSTIME
Time of access is not relevant for this strategy.

ISINSERTIONTIME

public static final boolean ISINSERTIONTIME
Time of insertion is not relevant for this strategy.

hits

private int hits
Number of hits.

misses

private int misses
Number of misses.
Constructor Detail

OPT

public OPT(boolean showDetails)
Creates a new instance of this strategy.
Method Detail

performEvalutation

public void performEvalutation(Memory memory,
                               ReferenceString refString,
                               SimuData simu,
                               GUI gui)
Performs a simulation to get the equivalent result with OPT in comparison to any other replace algorithm. It gets the complete referencestring and performs it on the given memory.

getVictimPage

public Page getVictimPage(Memory memory,
                          SimuData simu,
                          GUI gui)
Selects the next victim page. It's the oldest page in memory.
Overrides:
getVictimPage in class ReplaceStrategy

getHits

public int getHits()
Returns the number of hits in the last evalution run

getMisses

public int getMisses()
Returns the number of misses in the last evalution run