|
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.contactcenters.dialer.Dialer
public class Dialer
Represents a predictive dialer making outbound contacts. A predictive dialer is normally used to generate outbound calls. The dialer's policy determines the number of calls to try on each occasion (as a function of the system's state), and supplies a list to extract them from. This list could be produced by a contact factory and is often assumed to be infinite for simplicity. Such lists could also be constructed from customer contacts who left a message, who were disconnected, etc.
For each call extracted from the dialer list, a success test is performed. This test succeeds with a probability being fixed or depending on the tested call, and the state of the system. Successful calls represent right party connects whereas failed calls represent wrong party connects and connection failures. The dialer generates a random delay representing the time between the beginning of dialing and the success or failure. This delay may depend on the success indicator, the call itself, the current time, etc. An event for broadcasting the call to registered listeners is then scheduled to occur at the time of success or failure.
The dialer defines separate lists of new-contact listeners for right party connects, and failed calls. Usually, only right party connects reach the router, but statistical collectors may need to listen to failed calls as well.
Note: the order in which NewContactListener
implementations are
notified is unspecified, and a new-contact listener modifying a list of
listeners could result in unpredictable behavior.
Constructor Summary | |
---|---|
Dialer(DialerPolicy policy,
RandomStream streamReach,
ValueGenerator probReach)
Constructs a new dialer using the dialer policy policy, the random stream streamReach to determine if a dialed call reaches the right party, and with 0 reach and fail times. |
|
Dialer(DialerPolicy policy,
RandomStream streamReach,
ValueGenerator probReach,
ValueGenerator reachTimeGen,
ValueGenerator failTimeGen)
Constructs a new dialer using the dialer policy policy. |
|
Dialer(Simulator sim,
DialerPolicy policy,
RandomStream streamReach,
ValueGenerator probReach)
Equivalent to Dialer(DialerPolicy,RandomStream,ValueGenerator) ,
with the given user-defined simulator
sim. |
|
Dialer(Simulator sim,
DialerPolicy policy,
RandomStream streamReach,
ValueGenerator probReach,
ValueGenerator reachTimeGen,
ValueGenerator failTimeGen)
Equivalent to Dialer(DialerPolicy,RandomStream,ValueGenerator,ValueGenerator,ValueGenerator) ,
using the given simulator sim. |
Method Summary | |
---|---|
void |
addFailListener(NewContactListener listener)
Adds the new-contact listener listener which will be notified upon wrong party connects or connection failures. |
void |
addNewContactListener(NewContactListener listener)
Calls addReachListener(NewContactListener) . |
void |
addReachListener(NewContactListener listener)
Adds the new-contact listener listener which will be notified upon right party connects. |
void |
clearFailListeners()
Removes all new-contact listeners being notified when this dialer fails to make a contact. |
void |
clearNewContactListeners()
Calls clearReachListeners() . |
void |
clearReachListeners()
Removes all new-contact listeners being notified when this dialer makes a right party connect. |
void |
dial()
Instructs the dialer to try performing outbound calls. |
Iterator<DialerActionEvent> |
dialerActionEventsIterator()
Constructs and returns an iterator for the dialer-action events. |
Set<DialerActionEvent> |
getActionEvents()
Returns a set containing all the currently scheduled DialerActionEvent objects. |
DialerPolicy |
getDialerPolicy()
Returns the dialing policy used by this dialer. |
List<NewContactListener> |
getFailListeners()
Returns an unmodifiable list containing all the new-contact listeners notified when the dialer fails making a contact. |
ValueGenerator |
getFailTimeGenerator()
Returns the value generator for the fail times. |
String |
getName()
Returns the name associated with this object. |
List<NewContactListener> |
getNewContactListeners()
Returns the result of getReachListeners() . |
int |
getNumActionEvents()
Returns the number of action events currently scheduled by this dialer. |
int |
getNumActionEvents(int k)
|
ValueGenerator |
getProbReachGenerator()
Returns the value generator for the probability of a call to be successful, i.e., the probability of right party connect. |
List<NewContactListener> |
getReachListeners()
Returns an unmodifiable list containing all the new-contact listeners notified when a right-party connect occurs. |
ValueGenerator |
getReachTimeGenerator()
Returns the value generator for the reach times. |
RandomStream |
getStreamReach()
Returns the random stream used to determine if a called person is reached or not. |
void |
init()
Initializes the contact source for a new replication of a simulation. |
boolean |
isKeepingActionEvents()
Determines if this dialer is keeping the action events. |
boolean |
isStarted()
Determines if the element is enabled or disabled. |
boolean |
isSuccessful(Contact contact)
Determines if the call represented by contact is a right party connect. |
boolean |
isUsingNumActionsEvents()
Determines if the dial() method subtracts the
number of action events returned by getNumActionEvents()
from the return value of DialerPolicy.getNumDials(Dialer)
in order to determine the number of calls to dial. |
protected void |
notifyListeners(Contact contact,
boolean success)
Notifies registered new-contact listeners about the success or failure of the contact contact. |
void |
removeFailListener(NewContactListener listener)
Removes the new-contact listener listener from the list of listeners being notified upon wrong party connects or connection failures. |
void |
removeNewContactListener(NewContactListener listener)
Calls removeReachListener(NewContactListener) . |
void |
removeReachListener(NewContactListener listener)
Removes the new-contact listener listener from the list of listeners being notified upon right party connects. |
void |
restore(DialerState state)
Restores the state of this dialer with state information included in state. |
DialerState |
save()
Saves the state of this dialer and returns a state object containing the information. |
void |
setDialerPolicy(DialerPolicy policy)
Sets the dialing policy to policy. |
void |
setFailTimeGenerator(ValueGenerator failTimeGen)
Sets the value generator for fail times to failTimeGen. |
void |
setKeepingActionEvents(boolean keepActionEvents)
Sets the keep-dial-events indicator to keepActionEvents. |
void |
setName(String name)
Sets the name of this object to name. |
void |
setProbReachGenerator(ValueGenerator probReach)
Sets the value generator for right party connect probabilities to probReach. |
void |
setReachTimeGenerator(ValueGenerator reachTimeGen)
Sets the value generator for reach times to reachTimeGen. |
void |
setSimulator(Simulator sim)
Sets the simulator attached to this contact source to sim. |
void |
setStreamReach(RandomStream streamReach)
Sets the stream used to determine if a called person is reached to streamReach. |
void |
setUsingNumActionEvents(boolean useNumActionEvents)
Sets the flag for taking the number of action events into account while dialing to useNumActionEvents. |
Simulator |
simulator()
Returns a reference to the simulator associated with this contact source. |
void |
start()
Enables the element represented by this object. |
void |
startNoDial()
This is the same as start() , except that no call to dial()
is made after the dialer is started. |
void |
stop()
Disables the element represented by this object. |
void |
stopDial()
Stops any ongoing dialing of calls. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Dialer(DialerPolicy policy, RandomStream streamReach, ValueGenerator probReach)
policy
- the dialer's policy being used.streamReach
- the random number stream used to determine the success of a
dial.probReach
- the probability of reaching the right party.
NullPointerException
- if any argument is null.public Dialer(Simulator sim, DialerPolicy policy, RandomStream streamReach, ValueGenerator probReach)
Dialer(DialerPolicy,RandomStream,ValueGenerator)
,
with the given user-defined simulator
sim.
sim
- the simulator attached to the dialer.policy
- the dialer's policy being used.streamReach
- the random number stream used to determine the success of a
dial.probReach
- the probability of reaching the right party.
NullPointerException
- if any argument is null.public Dialer(DialerPolicy policy, RandomStream streamReach, ValueGenerator probReach, ValueGenerator reachTimeGen, ValueGenerator failTimeGen)
dial()
and the notification to the appropriate new-contact
listeners.
policy
- the dialer policy being used.streamReach
- the random number stream used to compute the status of a dial.probReach
- the probability of successful contact.reachTimeGen
- the value generator for the time between dialing and reaching.failTimeGen
- the value generator for the time between dialing and failing.
NullPointerException
- if any argument is null.public Dialer(Simulator sim, DialerPolicy policy, RandomStream streamReach, ValueGenerator probReach, ValueGenerator reachTimeGen, ValueGenerator failTimeGen)
Dialer(DialerPolicy,RandomStream,ValueGenerator,ValueGenerator,ValueGenerator)
,
using the given simulator sim.
sim
- the simulator attached to the dialer.policy
- the dialer policy being used.streamReach
- the random number stream used to compute the status of a dial.probReach
- the probability of successful contact.reachTimeGen
- the value generator for the time between dialing and reaching.failTimeGen
- the value generator for the time between dialing and failing.
NullPointerException
- if any argument is null.Method Detail |
---|
public Simulator simulator()
ContactSource
Any implementation of this interface
should provide a constructor
accepting the simulator as an argument.
Constructors not receiving a simulator
should use the default simulator
returned by Simulator.getDefaultSimulator()
.
simulator
in interface ContactSource
public void setSimulator(Simulator sim)
ContactSource
setSimulator
in interface ContactSource
sim
- the new simulator.public String getName()
Named
getName
in interface Named
public void setName(String name)
Named
UnsupportedOperationException
if the name is read-only.
setName
in interface Named
name
- the new name of the object.public void addNewContactListener(NewContactListener listener)
addReachListener(NewContactListener)
.
addNewContactListener
in interface ContactSource
listener
- the new-contact listener being added.
NullPointerException
- if listener is null.public void removeNewContactListener(NewContactListener listener)
removeReachListener(NewContactListener)
.
removeNewContactListener
in interface ContactSource
listener
- the new-contact listener being removed.public void clearNewContactListeners()
clearReachListeners()
.
clearNewContactListeners
in interface ContactSource
public List<NewContactListener> getNewContactListeners()
getReachListeners()
.
getNewContactListeners
in interface ContactSource
public void addReachListener(NewContactListener listener)
listener
- the new-contact listener being added.
NullPointerException
- if listener is null.public void removeReachListener(NewContactListener listener)
listener
- the new-contact listener being removed.public void clearReachListeners()
public List<NewContactListener> getReachListeners()
public void addFailListener(NewContactListener listener)
listener
- the new-contact listener being added.
NullPointerException
- if listener is null.public void removeFailListener(NewContactListener listener)
listener
- the new-contact listener being removed.public void clearFailListeners()
public List<NewContactListener> getFailListeners()
public DialerPolicy getDialerPolicy()
public void setDialerPolicy(DialerPolicy policy)
policy
- the new dialer's policy.
NullPointerException
- if policy is null.public RandomStream getStreamReach()
public void setStreamReach(RandomStream streamReach)
streamReach
- the new stream for success tests.
NullPointerException
- if streamReach is null.public ValueGenerator getProbReachGenerator()
public void setProbReachGenerator(ValueGenerator probReach)
probReach
- the value generator for right party connect probabilities.
NullPointerException
- if probReach is null.public ValueGenerator getReachTimeGenerator()
dial()
to the notification
of the successful call to the listeners.
public void setReachTimeGenerator(ValueGenerator reachTimeGen)
reachTimeGen
- the value generator for reach times.public ValueGenerator getFailTimeGenerator()
dial()
to the notification of
the failed call to the listeners.
public void setFailTimeGenerator(ValueGenerator failTimeGen)
failTimeGen
- the value generator for fail times.public boolean isSuccessful(Contact contact)
The default implementation uses the random stream returned by
getStreamReach()
to return true with some probability. The
probability of right party connect is generated using the value generator
returned by getProbReachGenerator()
.
contact
- the contact being tested.
public boolean isUsingNumActionsEvents()
dial()
method subtracts the
number of action events returned by getNumActionEvents()
from the return value of DialerPolicy.getNumDials(Dialer)
in order to determine the number of calls to dial.
When dial delays are large enough for the dialer to start
often while phone numbers are being composed,
the agents of the contact center might receive too many
calls to serve, which results in a large number of mismatches.
If this flag is enabled (the default), the dialer will take
into account
the number of calls for which dialing is in progress while
determining the number of additional calls to dial.
public void setUsingNumActionEvents(boolean useNumActionEvents)
useNumActionEvents
- the new value of the flag.isUsingNumActionsEvents()
public void dial()
The method uses the dialer's policy to get the appropriate number of calls
to dial as well as the dialer list. The contact objects representing the
calls being made are removed from the dialer list, and each call is tested
using isSuccessful(Contact)
. After the success indicator is determined, a
corresponding dial delay is generated, and an event is scheduled to happen
if the delay is non-zero. After the delay is elapsed, the appropriate
new-contact listeners are notified about the new call.
protected void notifyListeners(Contact contact, boolean success)
contact
- the contact to broadcast.success
- the success indicator.public void stopDial()
public DialerState save()
public void restore(DialerState state)
state
- the saved state of the dialer.public void init()
ContactSource
init
in interface ContactSource
init
in interface Initializable
public boolean isKeepingActionEvents()
getActionEvents()
method can be used to return a
set containing the events. Otherwise, the action events are stored in the
event list only, and cannot be enumerated by the dialer. By default, the
events are not stored by the dialer.
public void setKeepingActionEvents(boolean keepActionEvents)
keepActionEvents
- the new value of the indicator.isKeepingActionEvents()
public Iterator<DialerActionEvent> dialerActionEventsIterator()
isKeepingActionEvents()
returns true, the iterator is
constructed from the set returned by getActionEvents()
.
Otherwise, an iterator traversing the event list and filtering the
appropriate events is constructed and returned.
public Set<DialerActionEvent> getActionEvents()
DialerActionEvent
objects. If the dialer does not keep track of
these events, an IllegalStateException
is thrown.
public int getNumActionEvents()
public int getNumActionEvents(int k)
public boolean isStarted()
ToggleElement
isStarted
in interface ToggleElement
public void start()
ToggleElement
IllegalStateException
if the element is already enabled.
start
in interface ToggleElement
public void startNoDial()
start()
, except that no call to dial()
is made after the dialer is started. dial()
will then be called
only when an agent becomes free.
public void stop()
ToggleElement
IllegalStateException
if the element is already disabled.
stop
in interface ToggleElement
public String toString()
toString
in class Object
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |