ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.server
Class StartServiceEvent

java.lang.Object
  extended by umontreal.iro.lecuyer.simevents.Event
      extended by umontreal.iro.lecuyer.contactcenters.server.StartServiceEvent
All Implemented Interfaces:
Comparable<Event>

public class StartServiceEvent
extends Event

Represents an event that restarts the service of a contact. Service can be restarted in its communication phase, or in the after-contact work. This is used for state restoration of an agent group.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.simevents.Event
eventTime, priority, sim
 
Constructor Summary
StartServiceEvent(Agent targetAgent, Contact contact, double contactTime, int ecType)
          Constructs an event that will call targetAgent.getGroup().serve (contact, targetAgent, contactTime, ecType) when it happens.
StartServiceEvent(Agent targetAgent, Contact contact, double contactTime, int ecType, double afterContactTime, int esType)
          Constructs an event that will call targetAgent.getGroup().serve (contact, targetAgent, contactTime, ecType, afterContactTime, esType) when it happens.
StartServiceEvent(AgentGroup targetGroup, Contact contact, double contactTime, int ecType)
          Constructs an event that will call targetGroup.serve (contact, contactTime, ecType) when it happens.
StartServiceEvent(AgentGroup targetGroup, Contact contact, double contactTime, int ecType, double afterContactTime, int esType)
          Constructs an event that will call targetGroup.serve (contact, contactTime, ecType, afterContactTime, esType) when it happens.
StartServiceEvent(AgentGroup targetGroup, EndServiceEvent oldEndServiceEvent)
          Constructs a new start-service event that will put the contact in service represented by oldEndServiceEvent in the target agent group targetGroup.
StartServiceEvent(EndServiceEvent oldEndServiceEvent)
          Constructs a new start-service event that will put the contact in service represented by oldEndServiceEvent in the target agent group given by EndServiceEvent.getAgentGroup().
 
Method Summary
 void actions()
           
 boolean contactDone()
          Determines if the communication is finished between the contact and the agent.
 Contact getContact()
          Returns the contact being served.
 EndServiceEvent getNewEndServiceEvent()
          Returns the end-service event representing the contact's restarted service.
 double getScheduledAfterContactTime()
          Returns the scheduled after-contact time.
 double getScheduledContactTime()
          Returns the scheduled duration of the communication between the contact and an agent.
 int getScheduledEndContactType()
          Returns the type of contact termination that will occur when the end-service event happens for the first time.
 int getScheduledEndServiceType()
          Returns the type of the service termination that will occur when the end-service event happens for the second time.
 Agent getTargetAgent()
          Returns the target agent of this event, or null if no target agent was specified.
 AgentGroup getTargetAgentGroup()
          Returns the agent group that will receive the contact stored into the attached end-service event.
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StartServiceEvent

public StartServiceEvent(EndServiceEvent oldEndServiceEvent)
Constructs a new start-service event that will put the contact in service represented by oldEndServiceEvent in the target agent group given by EndServiceEvent.getAgentGroup().

Parameters:
oldEndServiceEvent - the old end-service event.

StartServiceEvent

public StartServiceEvent(AgentGroup targetGroup,
                         EndServiceEvent oldEndServiceEvent)
Constructs a new start-service event that will put the contact in service represented by oldEndServiceEvent in the target agent group targetGroup.

Parameters:
targetGroup - the target agent group.
oldEndServiceEvent - the old end-service event.

StartServiceEvent

public StartServiceEvent(AgentGroup targetGroup,
                         Contact contact,
                         double contactTime,
                         int ecType)
Constructs an event that will call targetGroup.serve (contact, contactTime, ecType) when it happens.

Parameters:
targetGroup - the target agent group.
contact - the contact to serve.
contactTime - the contact time.
ecType - the end-contact type.
Throws:
NullPointerException - if targetGroup or contact are null.
IllegalArgumentException - if contactTime is negative.

StartServiceEvent

public StartServiceEvent(AgentGroup targetGroup,
                         Contact contact,
                         double contactTime,
                         int ecType,
                         double afterContactTime,
                         int esType)
Constructs an event that will call targetGroup.serve (contact, contactTime, ecType, afterContactTime, esType) when it happens.

Parameters:
targetGroup - the target agent group.
contact - the contact to serve.
contactTime - the contact time.
ecType - the end-contact type.
afterContactTime - the after-contact time.
esType - the end-service type.
Throws:
NullPointerException - if targetGroup or contact are null.
IllegalArgumentException - if contactTime or afterContactTime are negative.

StartServiceEvent

public StartServiceEvent(Agent targetAgent,
                         Contact contact,
                         double contactTime,
                         int ecType)
Constructs an event that will call targetAgent.getGroup().serve (contact, targetAgent, contactTime, ecType) when it happens.

Parameters:
targetAgent - the target agent.
contact - the contact to serve.
contactTime - the contact time.
ecType - the end-contact type.
Throws:
NullPointerException - if targetAgent or contact are null.
IllegalArgumentException - if contactTime is negative.

StartServiceEvent

public StartServiceEvent(Agent targetAgent,
                         Contact contact,
                         double contactTime,
                         int ecType,
                         double afterContactTime,
                         int esType)
Constructs an event that will call targetAgent.getGroup().serve (contact, targetAgent, contactTime, ecType, afterContactTime, esType) when it happens.

Parameters:
targetAgent - the target agent.
contact - the contact to serve.
contactTime - the contact time.
ecType - the end-contact type.
afterContactTime - the after-contact time.
esType - the end-service type.
Throws:
NullPointerException - if targetAgent or contact are null.
IllegalArgumentException - if contactTime or afterContactTime are negative.
Method Detail

getTargetAgentGroup

public AgentGroup getTargetAgentGroup()
Returns the agent group that will receive the contact stored into the attached end-service event.

Returns:
the target agent group.

getTargetAgent

public Agent getTargetAgent()
Returns the target agent of this event, or null if no target agent was specified.

Returns:
the target agent.

getContact

public Contact getContact()
Returns the contact being served.

Returns:
the contact being served.

getScheduledContactTime

public double getScheduledContactTime()
Returns the scheduled duration of the communication between the contact and an agent.

Returns:
the scheduled contact time.

getScheduledAfterContactTime

public double getScheduledAfterContactTime()
Returns the scheduled after-contact time. If the after-contact time was not set, an IllegalStateException is thrown.

Returns:
the scheduled after-contact time.
Throws:
IllegalStateException - if the after-contact time was not set.

getScheduledEndContactType

public int getScheduledEndContactType()
Returns the type of contact termination that will occur when the end-service event happens for the first time.

Returns:
the scheduled end-contact type.

getScheduledEndServiceType

public int getScheduledEndServiceType()
Returns the type of the service termination that will occur when the end-service event happens for the second time.

Returns:
the scheduled end-service type.

contactDone

public boolean contactDone()
Determines if the communication is finished between the contact and the agent.

Returns:
true if the contact was served, false otherwise.

getNewEndServiceEvent

public EndServiceEvent getNewEndServiceEvent()
Returns the end-service event representing the contact's restarted service. This returns a non-null value only after the execution of the actions() method.

Returns:
the new dequeue event.

actions

public void actions()
Specified by:
actions in class Event

toString

public String toString()
Overrides:
toString in class Object

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.