|
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.simevents.Event
umontreal.iro.lecuyer.contactcenters.queue.DequeueEvent
public final class DequeueEvent
Represents an event happening when a contact leaves a waiting queue without
being explicitly removed. This event also holds the necessary information
about a contact in queue and is added to the waiting queue's data structure.
When it becomes obsolete, it can be used to keep track of
the queueing step of the concerned contact. For this reason, the event
implements the ContactStepInfo
interface.
Note that the natural ordering of dequeue events
corresponds to ascending order of automatic removal
from queue, not the order of insertion.
This is adapted for insertion of dequeue events in
event lists, not for priority queues.
The class DequeueEventComparator
must
be used to impose the order of insertion, for
priority queues.
This comparator is used when calling the
default constructor of PriorityWaitingQueue
and QueueWaitingQueue
.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.simevents.Event |
---|
eventTime, priority, sim |
Constructor Summary | |
---|---|
protected |
DequeueEvent(WaitingQueue queue,
Contact contact,
double enqueueTime)
Constructs a new dequeue event with contact contact entering waiting queue queue at simulation time enqueueTime. |
Method Summary | |
---|---|
void |
actions()
|
DequeueEvent |
clone()
Returns a copy of this event. |
DequeueEvent |
clone(Contact clonedContact)
Similar to clone() , but initializes the contact
of the cloned event with clonedContact instead of
a clone of the contact returned by getContact() . |
int |
compareTo(DequeueEvent ev)
Compares this dequeue event with the other event ev. |
boolean |
dequeued()
Indicates that the contact has left the queue and that this event is obsolete. |
Contact |
getContact()
Returns a reference to the queued contact. |
int |
getEffectiveDequeueType()
Returns the effective dequeue type of the contact having waited in this queue. |
double |
getEffectiveQueueTime()
Returns the simulation time the contact has effectively spent in queue. |
double |
getEndingTime()
Returns the simulation time at which this step ended. |
double |
getEnqueueTime()
Returns the simulation time at which the contact was enqueued. |
int |
getScheduledDequeueType()
Returns the scheduled dequeue type of the contact if this event occurs. |
double |
getScheduledQueueTime()
Returns the scheduled queue time for this contact. |
double |
getStartingTime()
Returns the simulation time at which this step started. |
WaitingQueue |
getWaitingQueue()
Returns a reference to the waiting queue. |
boolean |
isObsolete()
Determines if this event is obsolete. |
boolean |
remove(int dqType1)
Removes this dequeue event from its associated waiting queue, with dequeue type dqType. |
void |
setScheduledDequeueType(int dqType)
Changes the dequeue type of the contact to dqType when the event occurs. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.simevents.Event |
---|
cancel, cancel, compareTo, getRa, priority, reschedule, schedule, scheduleAfter, scheduleBefore, scheduleNext, setPriority, setRa, setSimulator, setTime, simulator, time |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DequeueEvent(WaitingQueue queue, Contact contact, double enqueueTime)
This constructor is rarely used directly;
the recommended way to create dequeue
events is to use
WaitingQueue.add(Contact)
.
queue
- the associated waiting queue.contact
- the contact being queued.enqueueTime
- the time at which the contact
enters the queue.Method Detail |
---|
public Contact getContact()
getContact
in interface ContactStepInfo
public WaitingQueue getWaitingQueue()
public double getEnqueueTime()
public double getStartingTime()
ContactStepInfo
getStartingTime
in interface ContactStepInfo
public double getEndingTime()
ContactStepInfo
getEndingTime
in interface ContactStepInfo
public double getScheduledQueueTime()
public int getScheduledDequeueType()
public void setScheduledDequeueType(int dqType)
IllegalStateException
is thrown.
dqType
- the new type of removal.
IllegalStateException
- if the contact was dequeued.public double getEffectiveQueueTime()
IllegalStateException
- if the contact is still in queue.public int getEffectiveDequeueType()
IllegalStateException
if the contact is still in
queue.
IllegalStateException
- if the contact is still in queue.public boolean remove(int dqType1)
getWaitingQueue()
.remove (this, dqType)
,
and returns the result.
dqType1
- the dequeue type.
public boolean dequeued()
IllegalStateException
is thrown at the time it happens. The event
can be used as a data structure to keep a trace of the queueing process of
the contact.
public boolean isObsolete()
WaitingQueue.init()
, some dequeue events might still be in the
simulator's event list. One must use this method in actions()
to
test if this event is obsolete. If that returns true, one should
return immediately.
public void actions()
actions
in class Event
public int compareTo(DequeueEvent ev)
Contact
object from this event and from the
ev argument.
The Contact.compareTo(Contact)
method is then used to
compare objects. A contact that cannot be extracted is assigned the
null value and precedes any non-null contacts.
ev
- the other event being compared.
public String toString()
toString
in class Object
public DequeueEvent clone()
clone
in class Object
public DequeueEvent clone(Contact clonedContact)
clone()
, but initializes the contact
of the cloned event with clonedContact instead of
a clone of the contact returned by getContact()
.
This method can be useful when cloning a contact c
for which c.getSteps() returns a non-empty
list containing dequeue events.
In that case, the contact associated with the events included in c.getSteps() must
correspond to c rather than clones of c.
clone
in interface ContactStepInfo
clonedContact
- the contact being cloned.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |