ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.ctmc
Class LookupEvent

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

public class LookupEvent
extends Object
implements CCEvent

Represents a call center event using random bits to select the index of a subinterval corresponding to an event. The executed selected event might perform some action or a new indexed search. A lookup event can be constructed from any array of call center events. Alternatively, a method createIndex(double[],CCEventFactory[],int,int) is provided to construct a search index.


Constructor Summary
LookupEvent(CCEvent[] events)
          Creates a new lookup event selecting events from the given array events.
 
Method Summary
 TransitionType actions(CallCenterCTMCKI ctmc, int tr, int rv, int usedBits, boolean changeState)
          Performs the necessary actions for the transition, and returns the appropriate transition type.
static LookupEvent createIndex(double[] prob, CCEventFactory[] factories, int numIntervals, int maxBits)
          Creates a search index by partitioning the [0, 1] in numIntervals subintervals, and using a maximum of maxBits randm bits for the indexed search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupEvent

public LookupEvent(CCEvent[] events)
Creates a new lookup event selecting events from the given array events.

Parameters:
events - the array of events.
Method Detail

actions

public TransitionType actions(CallCenterCTMCKI ctmc,
                              int tr,
                              int rv,
                              int usedBits,
                              boolean changeState)
Description copied from interface: CCEvent
Performs the necessary actions for the transition, and returns the appropriate transition type. This method is called by CallCenterCTMCKI.nextStateInt(int) in order to generate a transition. Random bits can be obtained as needed by using the given integer rv, but the numUsedBits least significant bits of rv are already used before the method is called, i.e., to select the index of an event in a lookup table.

Specified by:
actions in interface CCEvent
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.
changeState - determines if the event can change the state of the CTMC.
Returns:
the type of the simulated transition.

createIndex

public static LookupEvent createIndex(double[] prob,
                                      CCEventFactory[] factories,
                                      int numIntervals,
                                      int maxBits)
Creates a search index by partitioning the [0, 1] in numIntervals subintervals, and using a maximum of maxBits randm bits for the indexed search. A subinterval is assigned an event l created with the factory factories[l] with probability prob[l].

Parameters:
prob - the probabilities of occurrence of the events.
factories - the event factories.
numIntervals - the number of subintervals.
maxBits - the maximal number of bits.
Returns:
the event performing the indexed search.

ContactCenters
V. 0.9.9.

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