|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Sim
Class Sim is the main driver for the whole simulation. It contains the mainLoop processing loop, as well as various various methods for gathering and printing statistics and generating debugging output.
Field Summary | |
static int |
BLOCKSIZE
The size of a disk block, in bytes |
static int |
DISK_TIME
The amount of time it takes for a disk operation |
static double |
ODD_BURST_PROB
Probability of an "unusual" CPU burst. |
static int |
SWAP_OVERHEAD
Penalty for starting or stopping a process. |
static boolean |
traceFlag
Trace flag. |
Constructor Summary | |
Sim()
|
Method Summary | |
static void |
debug(java.lang.String msg)
Print a message unconditionally. |
static int |
debugLevel()
Return the current level of debugging. |
static void |
mainLoop(java.lang.String scheduler,
java.lang.String fname,
int timer)
This is the main program that runs the simulation. |
static void |
moreVerbose()
Increase the verbosity of debugging. |
static int |
now()
Get the current time, in simulated milliseconds since startup. |
static void |
pl(java.lang.Object msg)
Print a message unconditionally without a header. |
static java.lang.String |
tod(int time)
Converts a time-stamp from ms to time of day in the format h:mm:ss.mmm This used to be written more "cleanly", but it turned out to consume a huge fraction of the entire time taken by the program, so it was re-written to avoid allocating and concatenating Strings until the very end. |
static boolean |
tracing()
Indicate whether all events should be traced. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int DISK_TIME
public static final int BLOCKSIZE
public static final int SWAP_OVERHEAD
public static final double ODD_BURST_PROB
Job#newBurst()
public static boolean traceFlag
Constructor Detail |
public Sim()
Method Detail |
public static int now()
public static void moreVerbose()
public static int debugLevel()
public static boolean tracing()
public static void mainLoop(java.lang.String scheduler, java.lang.String fname, int timer)
scheduler
- the name of a class that extends Scheduler,
which is used to schedule the CPU.fname
- the name of the trace file describing the jobs.timer
- the interval between clock interrupts (0 means the
interval timer is turned off).public static void debug(java.lang.String msg)
msg
- the message to print.public static void pl(java.lang.Object msg)
msg
- the message to print.public static java.lang.String tod(int time)
time
- the time of day in ms past midnight
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |