Class JobArrival
java.lang.Object
|
+----Device
|
+----JobArrival
- class JobArrival
- extends Device
JobArrival is a phony kind of device that "interrupts" when a new
job arrives in the system.
It works by reading a trace file that indicates the starting times
and resource requirements of jobs that were actually run on a real
system.
-
fileName
- The name of the trace file
-
traceFile
- The trace file itself
-
JobArrival(String)
- Initialize the device by opening the trace file.
-
start(Job, int)
- Read the next (or first) job description from the input file,
skipping molformed lines, and make it the current job, with
a simulated interrupt occurring at the arrival time of the job.
fileName
private String fileName
- The name of the trace file
traceFile
private BufferedReader traceFile
- The trace file itself
JobArrival
public JobArrival(String fname)
- Initialize the device by opening the trace file.
The first line is read whenever the device is started.
- Parameters:
- fname - the name of the trace file.
start
public void start(Job j,
int dummy)
- Read the next (or first) job description from the input file,
skipping molformed lines, and make it the current job, with
a simulated interrupt occurring at the arrival time of the job.
If no more valid lines appear in the file, schedule an interrupt
at time inifinity.
- Parameters:
- j - dummy argument to conform to the Device interface
- dummy - dummy argument to conform to the Device interface
- Overrides:
- start in class Device
- See Also:
- Device