Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.contactcenters.server
Class AgentGroup

    java.lang.Object
      java.util.AbstractCollection<EndServiceEvent>
          umontreal.iro.lecuyer.contactcenters.server.AgentGroup

All Implemented Interfaces:
  Iterable<EndServiceEvent>, Collection<EndServiceEvent>, Initializable, Named, PeriodChangeListener

Direct Known Subclasses:
  DetailedAgentGroup

    public class AgentGroup

extends AbstractCollection<EndServiceEvent>
implements PeriodChangeListener, Initializable, Named

Represents a group i of agents capable of serving some types of contacts. An instance of this class keeps counters for the number of agents in a group, and provides logic to manage the service of contacts. It also defines a list of observers being notified when the agent group changes.

An agent group contains Ni(t)∈ members at simulation time t. Among these agents, [i](t) are idle and [i](t) are busy. Since agents terminate their service before they leave, we can have Ni(t) < [i](t), in which case [i](t) = [i](t) - Ni(t) ghost agents need to disappear after they finish their work. As a result, the true number of agents in a group i at time t is given by Ni(t) + [i](t). New contacts are not accepted by the group when Ni(t)≤[i](t). Since [i](t) includes the ghost agents, we have

Ni(t) + [i](t) = [i](t) + [i](t). | (2)

Some idle agents may be unavailable to serve contacts at some times during their shift. They can be taking unplanned breaks, going to the bathroom, etc. These details can be modeled in the simulation if the appropriate information is available. But in practice they are often approximated by various models such as an efficiency factor εi∈[0, 1], which corresponds to the fraction of agents being effectively busy or available to serve contacts. If [i](t) = 0, the number of free agents [i](t) available to serve contacts is given by [i](t) = round(εiNi(t)) where round(⋅) rounds its argument to the nearest integer. If [i](t) > 0, the number of busy members of the group, [i](t) - [i](t), needs to be subtracted to get [i](t). This yields:

round(εiNi(t)) + [i](t) = [i](t) + [i](t). | (3)

If εi = 1, [i](t) = [i](t) and we are back to (2). This elementary efficiency model is provided because it can be used without simulating individual agents. When agents are differentiated, other more complex and more realistic models can easily be implemented by manipulating the state of agents during simulation.

The service of a contact, started by the `serve(Contact)` method, is divided in two steps. After communicating with a customer (first step), an agent can perform after-contact work (second step), e.g., update an account, take some notes, etc. After the first step, the contact may exit the system, or be transferred to another agent. However, the agent becomes free only after the second step (if any) is over. The end of these steps is scheduled using a simulation event `EndServiceEvent` that contains additional information about the service. Service can be terminated automatically through the event or manually through the `endContact(EndServiceEvent,int)` and `endService(EndServiceEvent,int)` methods of this class. Special indicators called the end-contact type and end-service type tell us which type of termination has occurred for each step. By default, the two steps of the service are terminated automatically after durations obtained using the `Contact.getDefaultContactTime()` and `Contact.getDefaultAfterContactTime()` methods of the concerned contact, respectively. These default times can be set to infinity if services need to be terminated manually, conditional on some event. The way times are obtained can also be changed by setting value generators using `setContactTimeGenerator(int,ValueGenerator)`, and `setAfterContactTimeGenerator(int,ValueGenerator)`, or by overriding `getContactTime(EndServiceEvent)` and `getAfterContactTime(EndServiceEvent)`.

Registered agent-group listeners can be notified when Ni(t) changes, when a service starts, and when it ends.

Note: the `AgentGroupListener` implementations are notified in the order of the list returned by `getAgentGroupListeners()`, and an agent-group listener modifying the list of listeners by using `addAgentGroupListener(AgentGroupListener)` or `removeAgentGroupListener(AgentGroupListener)` could result in unpredictable behavior.

An agent group can also be viewed as a collection of end-service events. For this reason, this class implements the `Collection` interface. The collection contains end-service events corresponding to in-progress services. Its size thus always corresponds to the number of busy agents.

Field Summary
`protected int` | `ecTypeRet` The end-contact type associated with the contact time returned by `getContactTime(EndServiceEvent)`.
`protected int` | `esTypeRet` The end-service type associated with the after-contact time returned by `getAfterContactTime(EndServiceEvent)`.

Constructor Summary
`AgentGroup(int n)` Constructs a new agent group with `n` available agents.
`AgentGroup(PeriodChangeEvent pce, int[] ns)` Constructs a new agent group with the period-change event `pce`, and `ns[p]` agents in the period `p`.

Method Summary
`void` | `addAgentGroupListener(AgentGroupListener listener)` Adds the agent-group listener `listener` to this object.
`void` | `changePeriod(PeriodChangeEvent pce1)` Switches to the next period defined by `pce`.
`void` | `clearAgentGroupListeners()` Removes all the agent-group listeners registered with this agent group.
`boolean` | `contains(Object o)`
`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`.
`Iterator<EndServiceEvent>` | `endServiceEventsIterator()` Constructs and returns an iterator for the end-service events.
`protected double` | `getAfterContactTime(EndServiceEvent es)` Generates and returns the after-contact time for the service represented by `es`.
`ValueGenerator` | `getAfterContactTimeGenerator(int esType)` Returns the value generator used to generate after-contact times for end-service type `esType`.
`List<AgentGroupListener>` | `getAgentGroupListeners()` Returns an unmodifiable list containing all the agent-group listeners registered with this agent group.
`int[]` | `getAllNumAgents()` Returns the array containing the number of agents for each period.
`Map<Object,Object>` | `getAttributes()` Returns the map containing the attributes for this agent group.
`protected double` | `getContactTime(EndServiceEvent es)` Generates and returns the contact time for the service represented by `es`.
`ValueGenerator` | `getContactTimeGenerator(int ecType)` Returns the value generator used to generate contact times for end-contact type `ecType`.
`double` | `getEfficiency()` Returns εi, the fraction of free and busy agents available to serve contacts over the total number of agents.
`Set<EndServiceEvent>` | `getEndServiceEvents()` Returns a reference to a set containing all the end-service events for this agent group.
`int` | `getId()` Returns the identifier associated with this agent group.
`String` | `getName()` Returns the name associated with this object.
`int` | `getNumAgents()` Returns the total number of agents in the agent group.
`int` | `getNumAgents(int p)` Returns the number of agents in period `p`.
`int` | `getNumBusyAgents()` Returns [i](t), the number of busy agents in the group.
`int` | `getNumBusyAgents(int k)` Returns the number of busy agents serving contacts of type k.
`int` | `getNumFreeAgents()` Returns [i](t), the total number of agents in the agent group which are available to process contacts.
`int` | `getNumGhostAgents()` Returns [i](t), the number of agents that should disappear immediately after they have finished serving a contact.
`int` | `getNumIdleAgents()` Returns [i](t), the number of idle agents in this agent group.
`PeriodChangeEvent` | `getPeriodChangeEvent()` Returns the period-change event associated with this agent group.
`void` | `init()` Initializes the agent group for a new simulation replication.
`boolean` | `isKeepingEndServiceEvents()` Determines if this object keeps track of the end-service events for contacts in service by an agent.
`Iterator<EndServiceEvent>` | `iterator()`
`protected void` | `notifyBeginService(EndServiceEvent es)` Notifies every registered listener that a service, represented by `es`, was started by this agent group.
`protected void` | `notifyChange()` Notifies every registered listener that the number of agents of this group has changed.
`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.
`protected void` | `notifyInit()` Notifies every registered listener that this agent group has been initialized.
`void` | `removeAgentGroupListener(AgentGroupListener listener)` Removes the agent-group listener `listener` from this object.
`void` | `restore(AgentGroupState state)` Restores the state of this agent group by using the `restore` method of `state`.
`AgentGroupState` | `save()` Constructs a new `AgentGroupState` instance holding the state of this agent group.
`EndServiceEvent` | `serve(Contact contact)` Begins the service of the contact `contact` and returns the constructed end-service event.
`EndServiceEvent` | `serve(Contact contact, double contactTime, int ecType)` This is similar to `serve(Contact)`, except that the specified contact time and end-contact type are used instead of generated ones.
`EndServiceEvent` | `serve(Contact contact, double contactTime, int ecType, double afterContactTime, int esType)` This is similar to `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` | `setAfterContactTimeGenerator(int esType, ValueGenerator acgen)` Sets the after-contact time generator for end-service type `esType` to `acgen`.
`void` | `setContactTimeGenerator(int ecType, ValueGenerator cgen)` Sets the contact time generator for end-contact type `ecType` to `cgen`.
`void` | `setEfficiency(double eff)` Changes the agents' efficiency to `eff`.
`void` | `setId(int id)` Sets the identifier of this agent group to `id`.
`void` | `setKeepingEndServiceEvents(boolean keepEsev)` Sets the keep end-service-event indicator to `keepEsev`.
`void` | `setName(String name)` Sets the name of this object to `name`.
`void` | `setNumAgents(int n)` Changes the number of agents of this group to `n`.
`void` | `setNumAgents(int[] allNumAgents)` Sets the vector giving the number of agent for each period to `allNumAgents`.
`void` | `setNumAgents(int p, int n)` Sets the number of agents in period `p` to `n`.
`int` | `size()`
`void` | `stop(PeriodChangeEvent pce1)` This method is called after the period-change event is stopped by `PeriodChangeEvent.stop()`.
`String` | `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`

Field Detail

### ecTypeRet

    protected int ecTypeRet

  The end-contact type associated with the contact time returned by `getContactTime(EndServiceEvent)`.

### esTypeRet

    protected int esTypeRet

  The end-service type associated with the after-contact time returned by `getAfterContactTime(EndServiceEvent)`.

Constructor Detail

### AgentGroup

    public AgentGroup(int n)

  Constructs a new agent group with `n` available agents.

  Parameters:
    `n` - the number of agents in the group.

### AgentGroup

    public AgentGroup(PeriodChangeEvent pce,
                      int[] ns)

  Constructs a new agent group with the period-change event `pce`, and `ns[p]` agents in the period `p`. The agent group is automatically added to the period-change event for the number of agents to be set automatically during the simulation.

  Parameters:
    `pce` - the period-change event defining the simulation periods.
    `ns` - the number of agents in the group for each period.
  Throws:
    `IllegalArgumentException` - if there is not a number of agent for each period.

Method Detail

### getName

    public String getName()

  Description copied from interface: `Named`
  Returns the name associated with this object. If no name was set, this must return an empty string, not `null`.

  Specified by:
    `getName` in interface `Named`
  Returns:
    the name of this object.

### setName

    public void setName(String name)

  Description copied from interface: `Named`
  Sets the name of this object to `name`. The given name cannot be `null` and the implementation can throw an `UnsupportedOperationException` if the name is read-only.

  Specified by:
    `setName` in interface `Named`
  Parameters:
    `name` - the new name of the object.

### getPeriodChangeEvent

    public PeriodChangeEvent getPeriodChangeEvent()

  Returns the period-change event associated with this agent group.

  Returns:
    the associated period-change event.

### getEfficiency

    public double getEfficiency()

  Returns εi, the fraction of free and busy agents available to serve contacts over the total number of agents. The default efficiency is set to 1.

  Returns:
    the agents' efficiency.

### setEfficiency

    public void setEfficiency(double eff)

  Changes the agents' efficiency to `eff`. This calls `setNumAgents(int)` to update the number of free agents according to the new efficiency factor. If there is no busy agent, the number of free agents is given by `getNumAgents()``*eff`, rounded to the nearest integer. The efficiency factor must be in [0, 1], otherwise an exception is thrown.

  Parameters:
    `eff` - the new efficiency.
  Throws:
    `IllegalArgumentException` - if the efficiency factor is smaller than 0 or greater than 1.

### getContactTimeGenerator

    public ValueGenerator getContactTimeGenerator(int ecType)

  Returns the value generator used to generate contact times for end-contact type `ecType`. This returns `null` if there is no value generator associated with this type of contact termination. By default, a non-`null` value is returned for `ecType = 0` only.

  Parameters:
    `ecType` - the queried end-contact type.
  Returns:
    the value generator associated with this end-contact type.

### getAfterContactTimeGenerator

    public ValueGenerator getAfterContactTimeGenerator(int esType)

  Returns the value generator used to generate after-contact times for end-service type `esType`. This returns `null` if there is no value generator associated with this type of service termination.

  Parameters:
    `esType` - the queried end-service type.
  Returns:
    the value generator associated with this end-service type.

### setContactTimeGenerator

    public void setContactTimeGenerator(int ecType,
                                        ValueGenerator cgen)

  Sets the contact time generator for end-contact type `ecType` to `cgen`.

  Parameters:
    `ecType` - the affected end-contact type.
    `cgen` - the new contact time generator associated with this end-contact type.
  Throws:
    `IllegalArgumentException` - if the end-contact type is negative.

### setAfterContactTimeGenerator

    public void setAfterContactTimeGenerator(int esType,
                                             ValueGenerator acgen)

  Sets the after-contact time generator for end-service type `esType` to `acgen`.

  Parameters:
    `esType` - the affected end-service type.
    `acgen` - the new after-contact time generator associated with this end-service type.
  Throws:
    `IllegalArgumentException` - if the end-service type is negative.

### init

    public void init()

  Initializes the agent group for a new simulation replication. It must be called after the simulator is initialized and before it is started.

  Specified by:
    `init` in interface `Initializable`

### isKeepingEndServiceEvents

    public boolean isKeepingEndServiceEvents()

  Determines if this object keeps track of the end-service events for contacts in service by an agent. If this returns `true`, the events are stored. Otherwise (the default), they are stored in the SSJ event list only.

  Returns:
    the value of the keep end-service events flag.

### setKeepingEndServiceEvents

    public void setKeepingEndServiceEvents(boolean keepEsev)

  Sets the keep end-service-event indicator to `keepEsev`.

  Parameters:
    `keepEsev` - the new value of the indicator.
  See Also:
    `isKeepingEndServiceEvents()`

### endServiceEventsIterator

    public Iterator<EndServiceEvent> endServiceEventsIterator()

  Constructs and returns an iterator for the end-service events. If `isKeepingEndServiceEvents()` returns `true`, the iterator is constructed from the set returned by `getEndServiceEvents()`. Otherwise, an illegal state exception is thrown.

  Returns:
    the iterator for end-service events.

### iterator

    public Iterator<EndServiceEvent> iterator()

  Specified by:
    `iterator` in interface `Iterable<EndServiceEvent>`
  Specified by:
    `iterator` in interface `Collection<EndServiceEvent>`
  Specified by:
    `iterator` in class `AbstractCollection<EndServiceEvent>`

### size

    public int size()

  Specified by:
    `size` in interface `Collection<EndServiceEvent>`
  Specified by:
    `size` in class `AbstractCollection<EndServiceEvent>`

### contains

    public boolean contains(Object o)

  Specified by:
    `contains` in interface `Collection<EndServiceEvent>`
  Overrides:
    `contains` in class `AbstractCollection<EndServiceEvent>`

### getEndServiceEvents

    public Set<EndServiceEvent> getEndServiceEvents()

  Returns a reference to a set containing all the end-service events for this agent group. This set contains the end-service events for each contact currently served by an agent. As soon as a contact ends its service (including after-contact work), it is removed from the set. If the agent group does not keep track of these events (the default), this throws an `IllegalStateException`.

  Returns:
    the set of end-service events.
  Throws:
    `IllegalStateException` - if the agent group does not keep end-service events.

### serve

    public EndServiceEvent serve(Contact contact)

  Begins the service of the contact `contact` and returns the constructed end-service event. If no agent is available to serve the contact, an `IllegalStateException` is thrown. Otherwise, a contact time is obtained using `getContactTime(EndServiceEvent)`. The end-service event is then constructed and scheduled if the contact time is not infinite. If an infinite contact time is generated, one must manually abort the communication using `endContact(EndServiceEvent,int)` or schedule the end-service event. When the communication is over, the same rules are applied for generating the after-contact time using `getAfterContactTime(EndServiceEvent)`. When the after-contact time is finite, the end-service event is scheduled a second time for the service termination.

  Parameters:
    `contact` - the contact to be served.
  Returns:
    a reference to the end-service event.
  Throws:
    `IllegalStateException` - if no free agent is available.

### serve

    public EndServiceEvent serve(Contact contact,
                                 double contactTime,
                                 int ecType)

  This is similar to `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 `serve(Contact)`. The main purpose of this method is for recreating an end-service event based on saved state information.

  Parameters:
    `contact` - the contact being served.
    `contactTime` - the communication time of the contact with the agent.
    `ecType` - the end-contact type.
  Returns:
    the end-service event representing the service.
  Throws:
    `IllegalStateException` - if no free agent is available.

### serve

    public EndServiceEvent serve(Contact contact,
                                 double contactTime,
                                 int ecType,
                                 double afterContactTime,
                                 int esType)

  This is similar to `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.

  Parameters:
    `contact` - the contact being served.
    `contactTime` - the contact time.
    `ecType` - the end-contact type.
    `afterContactTime` - the after-contact time.
    `esType` - the end-service type.
  Returns:
    the end-service event representing the service.
  Throws:
    `IllegalStateException` - if no free agent is available.

### serve

    public EndServiceEvent serve(EndServiceEvent oldEndServiceEvent)

  Starts the service of a contact based on information stored in the old end-service event `oldEndServiceEvent`. If the event contains information about the effective end-contact time, i.e., if `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.

  Parameters:
    `oldEndServiceEvent` - the old end-service event.
  Returns:
    the new end-service event.

### save

    public AgentGroupState save()

  Constructs a new `AgentGroupState` instance holding the state of this agent group. The method `isKeepingEndServiceEvents()` must return `true` for this method to be called, because the state includes every contact served by agents in this group.

  Returns:
    the state of this agent group.

### restore

    public void restore(AgentGroupState state)

  Restores the state of this agent group by using the `restore` method of `state`.

  Parameters:
    `state` - the saved state of this agent group.

### getContactTime

    protected double getContactTime(EndServiceEvent es)

  Generates and returns the contact time for the service represented by `es`. The method returns the generated value and can store an end-contact type indicator in the protected field `ecTypeRet` if the default value of 0 is not appropriate.

  By default, a `MinValueGenerator` is used. For each end-contact type c with an associated value generator, a contact time Cc is generated. The scheduled contact time is Cc* = {Cc}, and the end-contact type is c*.

  Parameters:
    `es` - the end-service event.
  Returns:
    the generated contact time.

### getAfterContactTime

    protected double getAfterContactTime(EndServiceEvent es)

  Generates and returns the after-contact time for the service represented by `es`. The method returns the generated value and can store an end-service type indicator in the protected field `esTypeRet` if the default value of 0 is not appropriate.

  By default, a `MinValueGenerator` is used. For each end-service type c with an associated value generator, an after-contact time Cc is generated. The scheduled after-contact time is Cc* = {Cc}, and the end-service type is c*.

  Parameters:
    `es` - the end-service event.
  Returns:
    the generated after-contact time.

### endContact

    public 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`. Returns `true` if the operation was successful, or `false` otherwise. Note that the after-contact time is generated and after-contact work is performed. One must call `endService(EndServiceEvent,int)` after this method to completely abort the service.

  Parameters:
    `es` - the end-service event representing the service to be aborted.
    `ecType` - the type of communication termination.
  Returns:
    the success indicator of the operation.

### endService

    public 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`. Returns `true` if the operation was successful, or `false` otherwise. For this method to return `true`, the communication between the agent and the contactor must have ended. One can use `endContact(EndServiceEvent,int)` to abort the communication.

  Parameters:
    `es` - the end-service event representing the after-contact work to be aborted.
    `esType` - the type of service termination.
  Returns:
    the success indicator of the operation.

### getNumAgents

    public int getNumAgents()

  Returns the total number of agents in the agent group. It is possible that only a fraction of these agents can serve contacts.

  Returns:
    the total number of agents in the group.

### setNumAgents

    public void setNumAgents(int n)

  Changes the number of agents of this group to `n`. The number of free agents is computed by multiplying `n` by the efficiency factor, rounding the result to the nearest integer, and subtracting the number of busy members of the group.

  Parameters:
    `n` - the total number of agents.
  Throws:
    `IllegalArgumentException` - if the given number of agents is negative.

### getAllNumAgents

    public int[] getAllNumAgents()

  Returns the array containing the number of agents for each period. This method cannot be used unless the agent group is constructed with a period-change event.

  Returns:
    the number of agents for each period.
  Throws:
    `IllegalStateException` - if the per-period numbers of agents are not available.

### getNumAgents

    public int getNumAgents(int p)

  Returns the number of agents in period `p`. This method cannot be used unless the agent group is constructed with a period-change event.

  Parameters:
    `p` - the period index.
  Returns:
    the number of agents in the period.
  Throws:
    `IllegalStateException` - if the per-period numbers of agents are not available.
    `ArrayIndexOutOfBoundsException` - if the period index is negative or greater than or equal to the number of periods.

### setNumAgents

    public void setNumAgents(int p,
                             int n)

  Sets the number of agents in period `p` to `n`. This method cannot be used unless the agent group is constructed with a period-change event.

  Parameters:
    `p` - the period index.
    `n` - the new number of agents.
  Throws:
    `IllegalStateException` - if the per-period numbers of agents are not available.
    `ArrayIndexOutOfBoundsException` - if the period index is negative or greater than or equal to the number of periods.

### setNumAgents

    public void setNumAgents(int[] allNumAgents)

  Sets the vector giving the number of agent for each period to `allNumAgents`.

  Parameters:
    `allNumAgents` - the new vector of agents.

### getNumGhostAgents

    public int getNumGhostAgents()

  Returns [i](t), the number of agents that should disappear immediately after they have finished serving a contact. Such ghost agents appear when the total number of agents is set to be smaller than the number of busy agents.

  Returns:
    the number of ghost agents.

### getNumIdleAgents

    public int getNumIdleAgents()

  Returns [i](t), the number of idle agents in this agent group. Since only a fraction of these idle agents can serve contacts, the returned value is greater than or equal to `getNumFreeAgents()`. If `getEfficiency()` returns 1, this returns the same value as `getNumFreeAgents()`.

  Returns:
    the number of idle agents.

### getNumFreeAgents

    public int getNumFreeAgents()

  Returns [i](t), the total number of agents in the agent group which are available to process contacts. This number must always be smaller than or equal to the total number of agents.

  Returns:
    the number of free agents in the group.

### getNumBusyAgents

    public int getNumBusyAgents()

  Returns [i](t), the number of busy agents in the group. At any time during the simulation, the value returned by this method should be smaller than or equal to the sum of `getNumAgents()` and `getNumGhostAgents()`.

  Returns:
    the number of busy agents.

### getNumBusyAgents

    public int getNumBusyAgents(int k)

  Returns the number of busy agents serving contacts of type k.

  Parameters:
    `k` - the contact type index.
  Returns:
    the number of busy agents serving contacts of type `k`.

### getId

    public int getId()

  Returns the identifier associated with this agent group. This identifier, which defaults to `-1`, can be used as an index in routers.

  Returns:
    the identifier associated with this agent group.

### setId

    public void setId(int id)

  Sets the identifier of this agent group to `id`. Once this identifier is set to a positive or 0 value, it cannot be changed anymore. This method is automatically called by the router when an agent group is connected. If one tries to attach the same group to different routers, the group must have the same index for each of them. For this reason, if one tries to change the identifier, an `IllegalStateException` is thrown.

  Parameters:
    `id` - the new identifier associated with the agent group.
  Throws:
    `IllegalStateException` - if the identifier was already set.

### addAgentGroupListener

    public void addAgentGroupListener(AgentGroupListener listener)

  Adds the agent-group listener `listener` to this object.

  Parameters:
    `listener` - the agent-group listener being added.
  Throws:
    `NullPointerException` - if `listener` is `null`.

### removeAgentGroupListener

    public void removeAgentGroupListener(AgentGroupListener listener)

  Removes the agent-group listener `listener` from this object.

  Parameters:
    `listener` - the agent-group listener being removed.

### clearAgentGroupListeners

    public void clearAgentGroupListeners()

  Removes all the agent-group listeners registered with this agent group.

### getAgentGroupListeners

    public List<AgentGroupListener> getAgentGroupListeners()

  Returns an unmodifiable list containing all the agent-group listeners registered with this agent group.

  Returns:
    the list of all registered agent-group listeners.

### notifyInit

    protected void notifyInit()

  Notifies every registered listener that this agent group has been initialized.

### notifyChange

    protected void notifyChange()

  Notifies every registered listener that the number of agents of this group has changed.

### notifyBeginService

    protected void notifyBeginService(EndServiceEvent es)

  Notifies every registered listener that a service, represented by `es`, was started by this agent group.

  Parameters:
    `es` - the end-service event representing the service.

### notifyEndContact

    protected void notifyEndContact(EndServiceEvent es,
                                    boolean aborted)

  Notifies every registered listener that the communication part of the service represented by `es` has ended.

  Parameters:
    `es` - the end-service event.
    `aborted` - determines if the service was aborted or terminated normally.

### notifyEndService

    protected void notifyEndService(EndServiceEvent es,
                                    boolean aborted)

  Notifies every registered listener that the service represented by `es` is finished.

  Parameters:
    `es` - the end-service vent representing the ended service.
    `aborted` - determines if the after-contact work was aborted or terminated normally.

### getAttributes

    public Map<Object,Object> getAttributes()

  Returns the map containing the attributes for this agent group. Attributes can be used to add user-defined information to agent group objects at runtime, without creating a subclass. However, for maximal efficiency, it is recommended to create a subclass of `AgentGroup` instead of using attributes.

  Returns:
    the map containing the attributes for this object.

### changePeriod

    public void changePeriod(PeriodChangeEvent pce1)

  Description copied from interface: `PeriodChangeListener`
  Switches to the next period defined by `pce`. This can change the parameters and correct scheduled events accordingly. If no parameters are available for the new period, the method should try to use those of the last available period. The listener is called after the period change has occurred, so `PeriodChangeEvent.getCurrentPeriod()` returns the index of the new period.

  Specified by:
    `changePeriod` in interface `PeriodChangeListener`
  Parameters:
    `pce1` - the source period-change event.

### stop

    public void stop(PeriodChangeEvent pce1)

  Description copied from interface: `PeriodChangeListener`
  This method is called after the period-change event is stopped by `PeriodChangeEvent.stop()`.

  Specified by:
    `stop` in interface `PeriodChangeListener`
  Parameters:
    `pce1` - the period-change event being stopped.

### toString

    public String toString()

  Overrides:
    `toString` in class `AbstractCollection<EndServiceEvent>`

Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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