ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.msk.model
Class AgentGroupManager

java.lang.Object
  extended by umontreal.iro.lecuyer.xmlbind.NamedInfo
      extended by umontreal.iro.lecuyer.contactcenters.msk.model.AgentGroupManager
Direct Known Subclasses:
AgentGroupManagerWithAgents, AgentGroupManagerWithSchedule, AgentGroupManagerWithStaffing

public class AgentGroupManager
extends NamedInfo

Manages an agent group in the call center model. This class implements the mechanisms necessary to construct the agent group, and to update its state during the simulation. It also manages agent disconnection if it is enabled.

By default, this agent group manager sets the number of agents in the managed group to 0, and does not change it during simulation. However, subclasses such as AgentGroupManagerWithStaffing can override the init() method in order to set and update the number of agents.


Constructor Summary
AgentGroupManager(CallCenter cc, AgentGroupParams par, int i)
          Constructs a new agent group manager for the call center cc, agent group i, and based on agent group parameters par.
 
Method Summary
 void connectToRouter(Router router)
          Connects the managed agent group to the router router by using the Router.setAgentGroup(int,AgentGroup) method.
static AgentGroupManager create(CallCenter cc, AgentGroupParams par, int i)
          Constructs and returns a new agent group manager for call center cc, agent group with index i, and parameters par.
protected  AgentGroup createAgentGroup(AgentGroupParams par, int i)
          Constructs and returns the ith agent group for this call center.
static boolean estimateParameters(AgentGroupParams par)
          Estimates parameters relative to the agent group described by par.
 AgentGroup getAgentGroup()
          Returns a reference to the managed agent group.
 double getAgentsMult()
          Returns the factor by which the number of agents in the managed group given in parameter file is multiplied.
 double getBusyCost()
          Returns the cost of a busy agent in the managed group during one simulation time unit.
 double getBusyCost(int mp)
          Returns the cost of a busy agent managed by this group during main period mp, during one simulation time unit.
 CallCenter getCallCenter()
          Returns a reference to the call center containing this agent group manager.
 MultiPeriodGen getDisconnectTimeGen()
          Returns the random variate generator used for disconnect times.
 int[] getEffectiveStaffing()
          Returns the staffing determining the effective number of agents in the managed group for each main period in the model.
 int getEffectiveStaffing(int mp)
          Returns element mp of the array that would be returned by getEffectiveStaffing().
 double getIdleCost()
          Returns the cost of an idle agent in the managed group during one simulation time unit.
 double getIdleCost(int mp)
          Returns the cost of an idle agent managed by this group during main period mp, during one simulation time unit.
 int getMaxAgents()
          Returns the maximal number of agents in the managed group.
 int getMaxAgents(int mp)
          Returns the maximal number of agents in the managed group during main period mp.
 int getMinAgents()
          Returns the minimal number of agents in the managed group.
 int getMinAgents(int mp)
          Returns the minimal number of agents in the managed group during main period mp.
 double getPerUseCost()
          Returns the cost incurred each time an agent in the managed group starts the service of a call.
 double getPerUseCost(int mp)
          Returns the cost incurred each time an agent in the managed group starts a service during main period mp.
 double[] getProbDisconnect()
          Returns an array giving the probabilities of disconnection, for each main period.
 double getProbDisconnect(int mp)
          Returns the probability that an agent ending a service during main period mp disconnects for a random time.
 RandomStream getProbDisconnectStream()
          Returns the random stream used to test if an agent disconnects after the end of a service.
 AgentGroupSchedule getSchedule()
          Returns the schedule associated with the managed agent group.
 int getSkillCount()
          Returns the skill count associated with the managed agent group, or Integer.MAX_VALUE if no skill count was set explicitly by the user.
 int[] getStaffing()
          Returns the raw staffing of the managed agent group.
 int getStaffing(int mp)
          Returns element mp of the array that would be returned by getStaffing().
 double getWeight()
          Returns the weight associated with the managed agent group.
 double getWeight(int mp)
          Returns the weight of the managed agent group during main period mp.
 void init()
          Calls init on the managed agent group.
 void setAgentsMult(double mult)
          Sets the multiplier of the managed agent group to mult.
 void setProbDisconnectStream(RandomStream dpStream)
          Sets the random stream used to test if an agents disconnects after the end of a service to dpStream.
protected  void setSchedule(AgentGroupSchedule schedule)
           
 
Methods inherited from class umontreal.iro.lecuyer.xmlbind.NamedInfo
getName, getProperties, getStringProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentGroupManager

public AgentGroupManager(CallCenter cc,
                         AgentGroupParams par,
                         int i)
                  throws AgentGroupCreationException
Constructs a new agent group manager for the call center cc, agent group i, and based on agent group parameters par.

Parameters:
cc - the call center model.
par - the parameters of the agent group to be managed.
i - the index of the agent group.
Throws:
AgentGroupCreationException - if an error occurs while constructing the agent group manager, or the associated agent group.
Method Detail

getAgentsMult

public double getAgentsMult()
Returns the factor by which the number of agents in the managed group given in parameter file is multiplied. This multiplier is reset to 1 if the number of agents is changed programmatically by, e.g., AgentGroupManagerWithStaffing.setStaffing(int[]).

Returns:
the multiplier for the managed agent group.

setAgentsMult

public void setAgentsMult(double mult)
Sets the multiplier of the managed agent group to mult.

Parameters:
mult - the new multiplier.

connectToRouter

public void connectToRouter(Router router)
Connects the managed agent group to the router router by using the Router.setAgentGroup(int,AgentGroup) method. If agent disconnection is enabled, this method also ensures that the listener handling disconnections is notified of events related to the agent group before the router.

Parameters:
router - the router the agent group is connected to.

getWeight

public double getWeight()
Returns the weight associated with the managed agent group.

Returns:
the weight of the managed agent group.

getSkillCount

public int getSkillCount()
Returns the skill count associated with the managed agent group, or Integer.MAX_VALUE if no skill count was set explicitly by the user.

This method is mainly for internal use; the recommended way to obtain the skill count is by using RouterManager.getSkillCount(int) after RouterManager.initSkillCounts(RouterParams) was called.

Returns:
the explicitly set skill count.

getIdleCost

public double getIdleCost()
Returns the cost of an idle agent in the managed group during one simulation time unit.

Returns:
the cost of an idle agent.

getBusyCost

public double getBusyCost()
Returns the cost of a busy agent in the managed group during one simulation time unit.

Returns:
the cost of a busy agent.

getPerUseCost

public double getPerUseCost()
Returns the cost incurred each time an agent in the managed group starts the service of a call.

Returns:
the per-use cost of agents in the managed group.

getIdleCost

public double getIdleCost(int mp)
Returns the cost of an idle agent managed by this group during main period mp, during one simulation time unit. This returns the result of getIdleCost() if no per-period cost were given by the user in parameter file.

Parameters:
mp - the index of the tested main period.
Returns:
the idle cost.

getBusyCost

public double getBusyCost(int mp)
Returns the cost of a busy agent managed by this group during main period mp, during one simulation time unit. This returns the result of getBusyCost() if no per-period cost were given by the user in parameter file.

Parameters:
mp - the index of the tested main period.
Returns:
the busy cost.

getPerUseCost

public double getPerUseCost(int mp)
Returns the cost incurred each time an agent in the managed group starts a service during main period mp. This method returns the result of getPerUseCost() if no per-period costs were given in parameter file.

Parameters:
mp - the index of the tested main period.
Returns:
the per-use cost.

getWeight

public double getWeight(int mp)
Returns the weight of the managed agent group during main period mp. If no per-period weights were given in parameter file, this method returns the result of getWeight().

Parameters:
mp - the index of the tested main period.
Returns:
the weight of the managed agent group.

getMaxAgents

public int getMaxAgents()
Returns the maximal number of agents in the managed group.

Returns:
the maximal number of agents in the managed group.

getMinAgents

public int getMinAgents()
Returns the minimal number of agents in the managed group.

Returns:
the minimal number of agents in the managed group.

getMaxAgents

public int getMaxAgents(int mp)
Returns the maximal number of agents in the managed group during main period mp. This method returns the result of getMaxAgents() if no per-period maximum number of agents were given in parameter file.

Parameters:
mp - the index of the tested main period.
Returns:
the maximal number of agents.

getMinAgents

public int getMinAgents(int mp)
Returns the minimal number of agents in the managed group during main period mp. This method returns the result of getMinAgents() if no per-period minimum number of agents were given in parameter file.

Parameters:
mp - the index of the tested main period.
Returns:
the minimal number of agents.

create

public static AgentGroupManager create(CallCenter cc,
                                       AgentGroupParams par,
                                       int i)
                                throws AgentGroupCreationException
Constructs and returns a new agent group manager for call center cc, agent group with index i, and parameters par. If the given parameters contain a staffing, an instance of AgentGroupManagerWithStaffing is created. If the parameters contain a schedule, an instance of AgentGroupManagerWithSchedule is constructed. If the parameters contain information about individual agents, an AgentGroupManagerWithAgents object is created. Otherwise, a plain AgentGroupManager object is created. The created object can, depending on parameters, be converted to an instance of AgentGroupManagerWithStaffing. The constructed (or converted) object is returned.

Parameters:
cc - the call center model.
par - the parameters of the agent group to be managed.
i - the index of the agent group.
Throws:
AgentGroupCreationException - if an error occurs while constructing the agent group manager, or the associated agent group.

createAgentGroup

protected AgentGroup createAgentGroup(AgentGroupParams par,
                                      int i)
                               throws AgentGroupCreationException
Constructs and returns the ith agent group for this call center. By default, this constructs an AgentGroup or DetailedAgentGroup instance, depending on the return value of the AgentGroupParams.isDetailed() method.

Parameters:
i - the agent group index.
Returns:
the constructed agent group.
Throws:
AgentGroupCreationException

getCallCenter

public CallCenter getCallCenter()
Returns a reference to the call center containing this agent group manager.


getProbDisconnectStream

public RandomStream getProbDisconnectStream()
Returns the random stream used to test if an agent disconnects after the end of a service.


setProbDisconnectStream

public void setProbDisconnectStream(RandomStream dpStream)
Sets the random stream used to test if an agents disconnects after the end of a service to dpStream.


getDisconnectTimeGen

public MultiPeriodGen getDisconnectTimeGen()
Returns the random variate generator used for disconnect times.


getAgentGroup

public AgentGroup getAgentGroup()
Returns a reference to the managed agent group.


getProbDisconnect

public double[] getProbDisconnect()
Returns an array giving the probabilities of disconnection, for each main period.


getProbDisconnect

public double getProbDisconnect(int mp)
Returns the probability that an agent ending a service during main period mp disconnects for a random time.


init

public void init()
Calls init on the managed agent group.


getStaffing

public int[] getStaffing()
Returns the raw staffing of the managed agent group. The returned array gives the number of agents in the managed group during each main period in the model, before any multiplier is applied.

This method is mainly for internal use; the getEffectiveStaffing() method should be used instead to take multipliers into account.

The default behavior of this method is to return an array of 0's.

Returns:
the raw staffing for the managed agent group.

getStaffing

public int getStaffing(int mp)
Returns element mp of the array that would be returned by getStaffing().

As with getStaffing(), this method is for internal use. The method getEffectiveStaffing(int) should be used instead.

Parameters:
mp - the index of the tested main period.
Returns:
the raw staffing.

getEffectiveStaffing

public int[] getEffectiveStaffing()
Returns the staffing determining the effective number of agents in the managed group for each main period in the model. This method calls getStaffing(), and multiplies each element of the returned array by m*mi, where m is determined by CallCenter.getAgentsMult() and mi is given by getAgentsMult(). The resulting numbers are rounded to the nearest integers, and stored in the array being returned.

Returns:
the effective staffing.

getEffectiveStaffing

public int getEffectiveStaffing(int mp)
Returns element mp of the array that would be returned by getEffectiveStaffing().

Parameters:
mp - the index of the tested main period.
Returns:
the effective staffing.

getSchedule

public AgentGroupSchedule getSchedule()
Returns the schedule associated with the managed agent group. This corresponds to the effective schedule if this object is an instance of AgentGroupManagerWithSchedule. If this object is an instance of AgentGroupManagerWithStaffing converted from an instance with schedule, this returns the schedule of the original agent group manager with schedule. Otherwise, this method returns null.


setSchedule

protected void setSchedule(AgentGroupSchedule schedule)

estimateParameters

public static boolean estimateParameters(AgentGroupParams par)
                                  throws DistributionCreationException
Estimates parameters relative to the agent group described by par. The method estimates the parameters of the distribution for disconnect times. If the agent group has staffing information, the method then estimates staffing and probAgents from staffingData if staffingData is given. If scheduling information is used, the method calls AgentGroupSchedule.estimateParameters(AgentGroupScheduleParams) to complete parameter estimation.

Parameters:
par - the parameters of the agent group.
Returns:
true if and only if some parameters were estimated.
Throws:
DistributionCreationException - if an error occurs during parameter estimation.

ContactCenters
V. 0.9.9.

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