ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.ctmc
Class EventWithSelection

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.ctmc.EventWithTest
      extended by umontreal.iro.lecuyer.contactcenters.ctmc.EventWithSelection
All Implemented Interfaces:
CCEvent

public abstract class EventWithSelection
extends EventWithTest

Represents an event that can select the integers k = 0,…, K - 1 and p = 0,…, nk - 1 such that 0≤u - $ \htsum_{{j=0}}^{{k-1}}$Wjnj - pWk < wk. Here 0≤u1 < u2WN where wkWkW for k = 0,…, K - 1, and $ \htsum_{{k=0}}^{{K-1}}$nkN. This can be interpreted as selecting an event p = 0,…, nk - 1 of type k, with each event of type k having weight wk.

This class can be used, e.g., to determine if a uniform u generates a false transition, or an abandonment of type k. In this case, nk gives the number of queued contacts of type k, wk = νk is the abandonment rate for contacts of type k, Wk = $ \tilde{\nu}_{k}^{}$ is the maximal possible abandonment rate for contacts of type k, and N is the total queue capacity. The integer p then corresponds to the position of the contact in queue having abandoned.

To use this class, one must extend it to provide implementations for getNumValues(CallCenterCTMCKI), and getNumValues(CallCenterCTMCKI,int). In the CCEvent.actions(CallCenterCTMCKI,int,int,int,boolean) method, one then calls selectType(CallCenterCTMCKI,int,int,int) to select the event type.


Constructor Summary
EventWithSelection(double minU, double maxU, int numBits, int numTypes, double maxWeight)
          Constructs a new event with selection.
 
Method Summary
 int getLastSelectedEvent()
          Returns the index p of the last selected event among events of type k.
abstract  double getMaxWeight(CallCenterCTMCKI ctmc, int k)
          Returns the weight Wk corresponding to events of type k.
 int getNumTypes()
          Returns the number K of event types.
abstract  int getNumValues(CallCenterCTMCKI ctmc)
          Returns the sum $ \htsum_{{k=0}}^{{K-1}}$nk.
abstract  int getNumValues(CallCenterCTMCKI ctmc, int k)
          Returns the current value of nk.
abstract  double getWeight(CallCenterCTMCKI ctmc, int k)
          Returns the weight wk corresponding to events of type k.
 int selectType(CallCenterCTMCKI ctmc, int tr, int rv, int usedBits)
          Selects and returns an event type k.
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.ctmc.EventWithTest
getMaxU, getMinU, getPosition, getU, isUSmallerThan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface umontreal.iro.lecuyer.contactcenters.ctmc.CCEvent
actions
 

Constructor Detail

EventWithSelection

public EventWithSelection(double minU,
                          double maxU,
                          int numBits,
                          int numTypes,
                          double maxWeight)
Constructs a new event with selection.

Parameters:
minU - the value of u1.
maxU - the value of u2.
numBits - the number b of bits used to generate u when the test cannot be completed only with u1, and u2.
numTypes - the number K of event types.
maxWeight - the maximal weight W.
Method Detail

getNumTypes

public int getNumTypes()
Returns the number K of event types.

Returns:
the value of K.

getLastSelectedEvent

public int getLastSelectedEvent()
Returns the index p of the last selected event among events of type k.

Returns:
the last selected position.

getWeight

public abstract double getWeight(CallCenterCTMCKI ctmc,
                                 int k)
Returns the weight wk corresponding to events of type k.

Parameters:
ctmc - the tested CTMC.
k - the tested type.
Returns:
the weight wk.

getMaxWeight

public abstract double getMaxWeight(CallCenterCTMCKI ctmc,
                                    int k)
Returns the weight Wk corresponding to events of type k.

Parameters:
ctmc - the tested CTMC.
k - the tested type.
Returns:
the weight Wk.

getNumValues

public abstract int getNumValues(CallCenterCTMCKI ctmc,
                                 int k)
Returns the current value of nk.

Parameters:
ctmc - the tested CTMC.
k - the tested type.
Returns:
the value of nk.

getNumValues

public abstract int getNumValues(CallCenterCTMCKI ctmc)
Returns the sum $ \htsum_{{k=0}}^{{K-1}}$nk.

Parameters:
ctmc - the tested CTMC.
Returns:
the sum of nk's.

selectType

public int selectType(CallCenterCTMCKI ctmc,
                      int tr,
                      int rv,
                      int usedBits)
Selects and returns an event type k. If the event corresponds to a false transition, this returns K. Otherwise, the method getLastSelectedEvent() can be used to obtain p.

Parameters:
ctmc - the CTMC representing the call center.
tr - the number of transitions already done.
rv - the random integer used to simulate the transition.
usedBits - the number of bits already used in rv.
Returns:
the selected event type.

ContactCenters
V. 0.9.9.

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