public class TraceFile extends java.lang.Object implements ReflectionConstructable2<SimNode,Parameters>
hh:mm:ss.sss length
The time information can either be absolute or relative to the preeceding
event (=interarrival time), this can be set by absoluteTime
. For
absolute time stamps, all time stamps are shifted such that the first event
is at time zero.
Further the behavior at the end of the trace file can be determined. If
wrapFile
is set, the trace file is reread from the beginning.
Otherwise the simulation interrupts with an error when the end of the trace
file is reached. If time information is absolute, the duration between the
last item of run n
and the first item of run n+1
is
set to twice the duration between the last two items of run n
.
All following time stamps are shifted such that the remaining interarrival
times are the same as the differences of the time values in the trace file.
Comments are initiated by a leading '#'.
TraceFile
is a parseable class. It accepts the following
keywords in the parameter file:
TRUE
if the times in the trace file represent
absolute times. Set to FALSE
if they represent relative times
(i.e., time differences). Default is TRUE
TRUE
if you want the trace to be reread from the
beginning once the end is reached. If set to FALSE, an exception will be
thrown when the end of the trace file is reached. Default is
FALSE
.Modifier and Type | Field and Description |
---|---|
protected boolean |
absoluteTime
Contains the traceFile absolute or relative times
|
protected TraceItem |
currentItem |
protected boolean |
endOfFile |
protected java.io.RandomAccessFile |
file |
protected java.lang.String |
fileName |
protected boolean |
firstRunFinished |
protected Duration |
iat |
protected TraceItem |
previousItem |
protected Duration |
timeDiffForFirstItem
Determined from the first value
|
protected boolean |
wrapFile
Behavior, if the end of the file is reached
|
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
TraceFile(java.lang.String filename) |
TraceFile(java.lang.String fileName,
boolean absoluteTime,
boolean wrapFile) |
Modifier and Type | Method and Description |
---|---|
static TraceFile |
createInstance(SimNode ownNode,
Parameters pars)
as required by
ReflectionConstructable |
java.lang.String |
getFileName() |
PointInTime |
getNextEventTime(PointInTime currentTime) |
int |
getNextLength()
returns the length of the current message and moves to the next message
|
protected final java.lang.String fileName
protected final java.io.RandomAccessFile file
protected final boolean absoluteTime
protected final boolean wrapFile
protected final Duration timeDiffForFirstItem
protected TraceItem currentItem
protected TraceItem previousItem
protected Duration iat
protected boolean endOfFile
protected boolean firstRunFinished
public TraceFile(java.lang.String fileName, boolean absoluteTime, boolean wrapFile)
public TraceFile(java.lang.String filename)
public static TraceFile createInstance(SimNode ownNode, Parameters pars)
ReflectionConstructable
public PointInTime getNextEventTime(PointInTime currentTime)
public int getNextLength()
public java.lang.String getFileName()