|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<EndServiceEvent>
umontreal.iro.lecuyer.contactcenters.server.AgentGroup
umontreal.iro.lecuyer.contactcenters.server.DetailedAgentGroup
public class DetailedAgentGroup
Extends the AgentGroup
class for a detailed agent group, where
individual agents can be differentiated. When serving a contact, a specific
agent, represented by an instance of the class Agent
, must be chosen
automatically using the longest idle policy, or manually. At any time during
the simulation, agents can be added to or removed from the group. Agents can
also be made available or unavailable to process new contacts.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.contactcenters.server.AgentGroup |
---|
ecTypeRet, esTypeRet |
Constructor Summary | |
---|---|
DetailedAgentGroup(int n)
Constructs a new agent group with n available agents. |
|
DetailedAgentGroup(PeriodChangeEvent pce,
int[] ns)
Constructs a new agent group with the period-change event pce, and ns[p] agents in the period p. |
|
DetailedAgentGroup(Simulator sim,
int n)
|
Method Summary | |
---|---|
void |
addAgent(Agent agent)
Adds the agent agent to the agent group. |
protected Agent |
createAgent()
Constructs a new agent object. |
boolean |
endContact(EndServiceEvent es,
int ecType)
Aborts the communication with a contact identified by the end-service event es, overriding the event's end-contact type with ecType. |
boolean |
endService(EndServiceEvent es,
int esType)
Aborts the service of a contact identified by the end-service event es, overriding the event's end-service type with esType. |
protected double |
getAfterContactTime(EndServiceEvent es)
By default, this method calls Agent.getAfterContactTime(Contact) . |
List<Agent> |
getBusyAgents()
Returns a list containing all the busy agent objects which are members of this group. |
protected double |
getContactTime(EndServiceEvent es)
By default, this method calls Agent.getContactTime(Contact) . |
double |
getEfficiency()
Returns the current efficiency of this agent group, which is given by the fraction of available agents (free or busy) over the total number of agents. |
List<Agent> |
getGhostAgents()
Returns a list containing all the ghost agent objects having been members of this agent group and finishing an in-progress service. |
List<Agent> |
getIdleAgents()
Returns a list containing all the idle agent objects. |
Agent |
getLongestIdleAgent()
Returns the idle agent with the longest idle time in this agent group. |
int |
getNumAgents()
Returns the total number of agents in the agent group. |
int |
getNumBusyAgents()
Returns ![]() |
int |
getNumFreeAgents()
Returns the number of free agents available to process contacts. |
int |
getNumGhostAgents()
Returns ![]() |
void |
init()
Initializes the agent group for a new simulation replication. |
boolean |
isAddingAgent()
Determines if this agent group is currently adding an agent using the addAgent(Agent)
method. |
boolean |
isRemovingAgent()
Determines if an agent is currently being removed using removeAgent(Agent) . |
protected void |
notifyBeginService(EndServiceEvent es)
Notifies every registered listener that a service, represented by es, was started by this agent group. |
protected void |
notifyEndContact(EndServiceEvent es,
boolean aborted)
Notifies every registered listener that the communication part of the service represented by es has ended. |
protected void |
notifyEndService(EndServiceEvent es,
boolean aborted)
Notifies every registered listener that the service represented by es is finished. |
void |
removeAgent(Agent agent)
Removes the agent agent from this agent group. |
void |
restore(AgentGroupState state)
Restores the state of this agent group by using the restore method of
state. |
DetailedAgentGroupState |
save()
Constructs a new AgentGroupState instance holding the state of
this agent group. |
EndServiceEventDetailed |
serve(Contact contact)
Begins the service of the contact contact by the agent with the longest idle time in this group. |
EndServiceEventDetailed |
serve(Contact contact,
Agent agent)
Begins the service of the contact contact by the agent agent. |
EndServiceEventDetailed |
serve(Contact contact,
Agent agent,
double contactTime,
int ecType)
This is similar to serve(Contact,Agent) , except that the
specified contact time and end-contact type are used instead of generated
ones. |
EndServiceEventDetailed |
serve(Contact contact,
Agent agent,
double contactTime,
int ecType,
double afterContactTime,
int esType)
This is similar to serve(Contact,Agent) except that the contact
and after-contact times are specified explicitly. |
EndServiceEventDetailed |
serve(Contact contact,
double contactTime,
int ecType)
This is similar to AgentGroup.serve(Contact) , except that the specified
contact time and end-contact type are used instead of generated ones. |
EndServiceEventDetailed |
serve(Contact contact,
double contactTime,
int ecType,
double afterContactTime,
int esType)
This is similar to AgentGroup.serve(Contact) except that the contact and
after-contact times are specified explicitly. |
EndServiceEvent |
serve(EndServiceEvent oldEndServiceEvent)
Starts the service of a contact based on information stored in the old end-service event oldEndServiceEvent. |
void |
setEfficiency(double eff)
Sets the efficiency of the agents in the group. |
void |
setNumAgents(int n)
Sets the number of agents in the agent group to n. |
void |
setSimulator(Simulator sim)
Sets the attached simulator of this agent group to sim. |
Simulator |
simulator()
Returns a reference to the simulator used to obtain simulation times at which agents are added or become free, for computing login and idle times of agents. |
Methods inherited from class umontreal.iro.lecuyer.contactcenters.server.AgentGroup |
---|
addAgentGroupListener, changePeriod, clearAgentGroupListeners, contains, endServiceEventsIterator, getAfterContactTimeGenerator, getAgentGroupListeners, getAllNumAgents, getAttributes, getContactTimeGenerator, getEndServiceEvents, getId, getName, getNumAgents, getNumBusyAgents, getNumIdleAgents, getPeriodChangeEvent, isKeepingEndServiceEvents, iterator, notifyChange, notifyInit, removeAgentGroupListener, setAfterContactTimeGenerator, setContactTimeGenerator, setId, setKeepingEndServiceEvents, setName, setNumAgents, setNumAgents, size, stop, toString |
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
---|
public DetailedAgentGroup(int n)
n
- the number of agents in the group.public DetailedAgentGroup(Simulator sim, int n)
public DetailedAgentGroup(PeriodChangeEvent pce, int[] ns)
pce
- the period-change event defining the simulation periods.ns
- the number of agents in the group for each period.
IllegalArgumentException
- if there is not a number of agents for each period.Method Detail |
---|
public Simulator simulator()
public void setSimulator(Simulator sim)
sim
- the new attached simulator.public int getNumAgents()
AgentGroup
getNumAgents
in class AgentGroup
public void setNumAgents(int n)
createAgent()
method is used
to create the required new agents. When removing agents, the method uses
the busyness status (busy agents are removed only if there is no more idle
agent), and the login time (the agent with the longest login time is
chosen) to decide which agent to remove. The methods
addAgent(Agent)
and removeAgent(Agent)
are used to add
and remove the agents.
setNumAgents
in class AgentGroup
n
- the new number of agents.
IllegalArgumentException
- if the number of agents is negative.public void addAgent(Agent agent)
agent
- the agent being added.
NullPointerException
- if agent is null.
IllegalArgumentException
- if the agent is already in a group.public void removeAgent(Agent agent)
agent
- the agent being removed.
NullPointerException
- if agent is null.
IllegalArgumentException
- if the removed agent is not in this group.public boolean isAddingAgent()
addAgent(Agent)
method.
This method can be used by AgentGroupListener.agentGroupChange(AgentGroup)
to determine the origin of a change in an observed agent group.
If an agent is added explicitly using addAgent(Agent)
,
this method returns true.
Otherwise, the change originates from a call
to setNumAgents(int)
.
public boolean isRemovingAgent()
removeAgent(Agent)
.
This method can be used by an agent-group listener
as described in isAddingAgent()
.
public void init()
AgentGroup
init
in interface Initializable
init
in class AgentGroup
public List<Agent> getIdleAgents()
public List<Agent> getBusyAgents()
public List<Agent> getGhostAgents()
public int getNumFreeAgents()
Agent.isAvailable()
returns
true.
getNumFreeAgents
in class AgentGroup
public int getNumGhostAgents()
AgentGroup
getNumGhostAgents
in class AgentGroup
public int getNumBusyAgents()
AgentGroup
AgentGroup.getNumAgents()
and
AgentGroup.getNumGhostAgents()
.
getNumBusyAgents
in class AgentGroup
public double getEfficiency()
getEfficiency
in class AgentGroup
public void setEfficiency(double eff)
AgentGroup
base class. The recommended way to change the
efficiency is to change the availability of each individual agent by using
Agent.setAvailable(boolean)
. This permits the implementation of
more complex and realistic models of agents' availability.
setEfficiency
in class AgentGroup
eff
- the new agent group's efficiency.
IllegalArgumentException
- if eff is smaller than 0 or greater than 1.public Agent getLongestIdleAgent()
public EndServiceEventDetailed serve(Contact contact)
serve(Contact,Agent)
method is called to begin the service.
serve
in class AgentGroup
contact
- the contact being served.
public EndServiceEventDetailed serve(Contact contact, double contactTime, int ecType)
AgentGroup
AgentGroup.serve(Contact)
, except that the specified
contact time and end-contact type are used instead of generated ones. The
after-contact time is generated as in AgentGroup.serve(Contact)
. The main
purpose of this method is for recreating an end-service event based on
saved state information.
serve
in class AgentGroup
contact
- the contact being served.contactTime
- the communication time of the contact with the agent.ecType
- the end-contact type.
public EndServiceEventDetailed serve(Contact contact, double contactTime, int ecType, double afterContactTime, int esType)
AgentGroup
AgentGroup.serve(Contact)
except that the contact and
after-contact times are specified explicitly. The main purpose of this
method is for recreating an end-service event based on saved state
information.
serve
in class AgentGroup
contact
- the contact being served.contactTime
- the contact time.ecType
- the end-contact type.afterContactTime
- the after-contact time.esType
- the end-service type.
public EndServiceEventDetailed serve(Contact contact, Agent agent)
getContactTime(EndServiceEvent)
, and
after-contact times are obtained using
getAfterContactTime(EndServiceEvent)
.
contact
- the contact being served.agent
- the agent serving the contact.
NullPointerException
- if an argument is null.
IllegalArgumentException
- if the given agent is in the wrong agent group.
IllegalStateException
- if the agent is not available or already serving a contact.public EndServiceEventDetailed serve(Contact contact, Agent agent, double contactTime, int ecType)
serve(Contact,Agent)
, except that the
specified contact time and end-contact type are used instead of generated
ones. The after-contact time is generated as in serve(Contact)
.
The main purpose of this method is for recreating an end-service event
based on saved state information.
contact
- the contact being served.agent
- the agent serving the contact.contactTime
- the communication time of the contact with the agent.ecType
- the end-contact type.
IllegalStateException
- if no free agent is available.public EndServiceEventDetailed serve(Contact contact, Agent agent, double contactTime, int ecType, double afterContactTime, int esType)
serve(Contact,Agent)
except that the contact
and after-contact times are specified explicitly. The main purpose of this
method is for recreating an end-service event based on saved state
information.
contact
- the contact being served.agent
- the agent serving the contact.contactTime
- the contact time.ecType
- the end-contact type.afterContactTime
- the after-contact time.esType
- the end-service type.
IllegalStateException
- if no free agent is available.public EndServiceEvent serve(EndServiceEvent oldEndServiceEvent)
AgentGroup
EndServiceEvent.contactDone()
returns true, the method
uses the effective end-contact time and end-contact type, and the
scheduled end-service time and end-service type to start the service.
Otherwise, it uses the scheduled end-contact time and end-contact type
only.
serve
in class AgentGroup
oldEndServiceEvent
- the old end-service event.
public DetailedAgentGroupState save()
AgentGroup
AgentGroupState
instance holding the state of
this agent group. The method AgentGroup.isKeepingEndServiceEvents()
must
return true for this method to be called, because the state
includes every contact served by agents in this group.
save
in class AgentGroup
public void restore(AgentGroupState state)
AgentGroup
restore
method of
state.
restore
in class AgentGroup
state
- the saved state of this agent group.protected double getContactTime(EndServiceEvent es)
Agent.getContactTime(Contact)
. If
this returns Double.NaN
, the method of the superclass is called.
getContactTime
in class AgentGroup
es
- the end-service event.
protected double getAfterContactTime(EndServiceEvent es)
Agent.getAfterContactTime(Contact)
.
If the called method returns Double.NaN
, the method calls the
equivalent method of the superclass.
getAfterContactTime
in class AgentGroup
es
- the end-service event.
public boolean endContact(EndServiceEvent es, int ecType)
AgentGroup
AgentGroup.endService(EndServiceEvent,int)
after this method to completely abort the service.
endContact
in class AgentGroup
es
- the end-service event representing the service to be aborted.ecType
- the type of communication termination.
public boolean endService(EndServiceEvent es, int esType)
AgentGroup
AgentGroup.endContact(EndServiceEvent,int)
to abort the communication.
endService
in class AgentGroup
es
- the end-service event representing the after-contact work to be
aborted.esType
- the type of service termination.
protected void notifyBeginService(EndServiceEvent es)
AgentGroup
notifyBeginService
in class AgentGroup
es
- the end-service event representing the service.protected void notifyEndContact(EndServiceEvent es, boolean aborted)
AgentGroup
notifyEndContact
in class AgentGroup
es
- the end-service event.aborted
- determines if the service was aborted or terminated
normally.protected void notifyEndService(EndServiceEvent es, boolean aborted)
AgentGroup
notifyEndService
in class AgentGroup
es
- the end-service vent representing the ended service.aborted
- determines if the after-contact work was
aborted or terminated normally.protected Agent createAgent()
Agent
containing additional information.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |