public class JobQueueVisitLog<J extends SimJob,Q extends SimQueue> extends Object
Visit-logs play a crucial role in the testing sub-system of SimQueues.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
| Modifier and Type | Field and Description |
|---|---|
double |
arrivalTime
The arrival time, in case the job arrived.
|
boolean |
arrived
Whether the job arrived.
|
boolean |
departed
Whether the job departed.
|
double |
departureTime
The departure time in case the job departed.
|
boolean |
dropped
Whether the job was dropped.
|
double |
dropTime
The drop time in case the job was dropped.
|
J |
job
The job.
|
Q |
queue
The queue the job visits.
|
double |
revocationTime
The revocation time in case the job was successfully revoked.
|
boolean |
revoked
Whether the job was successfully revoked.
|
int |
sequenceNumber
The sequence number of arrivals at the same time.
|
boolean |
started
Whether the job started.
|
double |
startTime
The start time in case the job started.
|
| Constructor and Description |
|---|
JobQueueVisitLog(J job,
Q queue,
boolean arrived,
double arrivalTime,
int sequenceNumber,
boolean started,
double startTime,
boolean dropped,
double dropTime,
boolean revoked,
double revocationTime,
boolean departed,
double departureTime)
Creates a new job-centric record of a single queue visit.
|
| Modifier and Type | Method and Description |
|---|---|
static <J extends SimJob,Q extends SimQueue> |
addDepartedJob(Set<JobQueueVisitLog<J,Q>> visitLogs,
Q queue,
J job,
double arrivalTime,
boolean started,
double startTime,
double departureTime)
Adds a departed job at a queue to a set of
JobQueueVisitLogs. |
static <J extends SimJob,Q extends SimQueue> |
addDroppedJob(Set<JobQueueVisitLog<J,Q>> visitLogs,
Q queue,
J job,
double arrivalTime,
boolean started,
double startTime,
double dropTime)
Adds a dropped job at a queue to a set of
JobQueueVisitLogs. |
static <J extends SimJob,Q extends SimQueue> |
addRevokedJob(Set<JobQueueVisitLog<J,Q>> visitLogs,
Q queue,
J job,
double arrivalTime,
boolean started,
double startTime,
double revocationTime)
Adds a revoked job at a queue to a set of
JobQueueVisitLogs. |
static <J extends SimJob,Q extends SimQueue> |
addStickyJob(Set<JobQueueVisitLog<J,Q>> visitLogs,
Q queue,
J job,
double arrivalTime,
boolean started,
double startTime)
Adds a sticky job (never leaves) at a queue to a set of
JobQueueVisitLogs. |
<R extends SimQueue> |
copyForQueue(R destQueue)
Creates a copy of this visit log, but replaces the queue with given one, the destination queue.
|
boolean |
equals(JobQueueVisitLog object,
double accuracy)
Tests this
JobQueueVisitLog with a supplied one for equality. |
void |
print(PrintStream out)
Prints this visit log to the supplied stream.
|
public final boolean arrived
public final double arrivalTime
public final int sequenceNumber
public final boolean started
public final double startTime
public final boolean dropped
public final double dropTime
public final boolean revoked
public final double revocationTime
public final boolean departed
public final double departureTime
public JobQueueVisitLog(J job, Q queue, boolean arrived, double arrivalTime, int sequenceNumber, boolean started, double startTime, boolean dropped, double dropTime, boolean revoked, double revocationTime, boolean departed, double departureTime)
job - The job.queue - The queue the job visits.arrived - Whether the job arrived.arrivalTime - The arrival time, in case the job arrived.sequenceNumber - The sequence number of arrivals at the same time, starting with zero.started - Whether the job started.startTime - The start time in case the job started.dropped - Whether the job was dropped.dropTime - The drop time in case the job was dropped.revoked - Whether the job was successfully revoked.revocationTime - The revocation time in case the job was successfully revoked.departed - Whether the job departed.departureTime - The departure time in case the job departed.IllegalArgumentException - If the job or queue is null, or sanity checks fail in view of the allowable
life cycles of a job visit (e.g., a job cannot start before it has arrived,
it cannot both be dropped and be revoked, etc.).public <R extends SimQueue> JobQueueVisitLog<J,R> copyForQueue(R destQueue)
R - The (generic) type of the destination queue.destQueue - The destination queue, non-null.IllegalArgumentException - If the destination queue is null.public boolean equals(JobQueueVisitLog object, double accuracy)
JobQueueVisitLog with a supplied one for equality.
All boolean and integer fields are simply tested for equality.
The various time fields are only compared if the corresponding condition is true, e.g.,
the startTime fields are only checked if started== true (on both objects).
object - The other JobQueueVisitLog; may be null or this, resulting in false and
true, respectively.accuracy - The absolute allowed deviation for the double comparisons; non-negative.IllegalArgumentException - If the accuracy is negative (zero is allowed).public void print(PrintStream out)
out - The stream, if null, System.out is used.public static <J extends SimJob,Q extends SimQueue> void addDroppedJob(Set<JobQueueVisitLog<J,Q>> visitLogs, Q queue, J job, double arrivalTime, boolean started, double startTime, double dropTime)
JobQueueVisitLogs.J - The type of SimJobs supported.Q - The type of SimQueues supported.visitLogs - The set.queue - The queue.job - The job.arrivalTime - The arrival time.started - Whether the job has already started.startTime - The start time of the job, if started.dropTime - The drop time.IllegalArgumentException - If the set, queue, or job is null,
or if sanity checks on the time arguments fail.public static <J extends SimJob,Q extends SimQueue> void addRevokedJob(Set<JobQueueVisitLog<J,Q>> visitLogs, Q queue, J job, double arrivalTime, boolean started, double startTime, double revocationTime)
JobQueueVisitLogs.J - The type of SimJobs supported.Q - The type of SimQueues supported.visitLogs - The set.queue - The queue.job - The job.arrivalTime - The arrival time.started - Whether the job has already started.startTime - The start time of the job, if started.revocationTime - The revocation time.IllegalArgumentException - If the set, queue, or job is null,
or if sanity checks on the time arguments fail.public static <J extends SimJob,Q extends SimQueue> void addDepartedJob(Set<JobQueueVisitLog<J,Q>> visitLogs, Q queue, J job, double arrivalTime, boolean started, double startTime, double departureTime)
JobQueueVisitLogs.J - The type of SimJobs supported.Q - The type of SimQueues supported.visitLogs - The set.queue - The queue.job - The job.arrivalTime - The arrival time.started - Whether the job has already started.startTime - The start time of the job, if started.departureTime - The departure time.IllegalArgumentException - If the set, queue, or job is null,
or if sanity checks on the time arguments fail.public static <J extends SimJob,Q extends SimQueue> void addStickyJob(Set<JobQueueVisitLog<J,Q>> visitLogs, Q queue, J job, double arrivalTime, boolean started, double startTime)
JobQueueVisitLogs.J - The type of SimJobs supported.Q - The type of SimQueues supported.visitLogs - The set.queue - The queue.job - The job.arrivalTime - The arrival time.started - Whether the job has already started.startTime - The start time of the job, if started.IllegalArgumentException - If the set, queue, or job is null,
or if sanity checks on the time arguments fail.Copyright © 2018. All rights reserved.