|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.contactcenters.app.trace.FileContactTrace
public class FileContactTrace
Defines an exited-contact listener used to output a trace of every call processed by a simulator into a text file. Each time a new contact is notified to this listener, a line is appended to a writer linked to a file. This results in a call-by-call trace of the simulation. If an I/O exception is thrown at any given time by the writer, the exception's stack trace is logged, and this call tracer is disabled to avoid getting any further exception message.
Field Summary |
---|
Fields inherited from interface umontreal.iro.lecuyer.contactcenters.app.trace.ContactTrace |
---|
OUTCOME_ABANDONED, OUTCOME_BLOCKED, OUTCOME_FAILED, OUTCOME_SERVED |
Constructor Summary | |
---|---|
FileContactTrace(File traceFile,
int timePrecision)
Constructs a new call trace sending the information to the text file traceFile. |
Method Summary | |
---|---|
void |
close()
Closes the trace facility after a simulation. |
static ContactTrace |
create(CallTraceParams traceParams)
Creates a new contact trace facility from the given parameters. |
String |
getHeader()
Returns a string containing the field names for this trace. |
static String |
getHeader(int timePrecision)
|
void |
init()
Initializes the tracing mechanism. |
void |
writeHeader()
Writes the output of getHeader() in the trace file, followed by an
end-line character. |
void |
writeLine(int step,
int type,
int period,
double arvTime,
double queueTime,
String outcome,
int group,
double srvTime)
Writes a new line in the trace representing a simulated contact. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileContactTrace(File traceFile, int timePrecision)
traceFile
- the output trace file.timePrecision
- the number of digits for arrival, waiting, and service times.Method Detail |
---|
public static ContactTrace create(CallTraceParams traceParams)
More specifically,
if these parameters include information on a database
connection, a DBContactTrace
instance is returned.
Otherwise, if the name of the output file of the trace ends
with .xls, an
ExcelContactTrace
is returned.
Otherwise, a FileContactTrace
is returned.
traceParams
- the parameters of the trace.
public void init()
ContactTrace
init
in interface ContactTrace
public void close()
ContactTrace
close
in interface ContactTrace
public String getHeader()
public static String getHeader(int timePrecision)
public void writeHeader()
getHeader()
in the trace file, followed by an
end-line character.
public void writeLine(int step, int type, int period, double arvTime, double queueTime, String outcome, int group, double srvTime)
ContactTrace
Double.NaN
if the information does not exist. For example,
a blocked or abandoned call does not have a serving agent group, or
a service time.
writeLine
in interface ContactTrace
step
- the step, in the experiment, during which the call occurred.type
- the type of the call.period
- the period of arrival of the call.arvTime
- the arrival time.queueTime
- the time spent by the call in the queue.outcome
- the outcome of the call.group
- the group of the serving agent.srvTime
- the service time of the call.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |