ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.contact
Class NORTADrivenArrivalProcess

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess
      extended by umontreal.iro.lecuyer.contactcenters.contact.PoissonUniformArrivalProcess
          extended by umontreal.iro.lecuyer.contactcenters.contact.NORTADrivenArrivalProcess
All Implemented Interfaces:
ContactSource, Initializable, Named, ToggleElement

public class NORTADrivenArrivalProcess
extends PoissonUniformArrivalProcess

Represents an arrival process in which the numbers of arrivals per-period are correlated negative binomial random variables, generated using the NORTA method. To generate the number of arrivals, the process first obtains a vector $ \boldX$ = (X1,…, XP) from the multivariate normal distribution with mean vector 0 and covariance matrix $ \boldSigma$. Assuming that $ \boldSigma$ is a correlation matrix, i.e., each element is in [- 1, 1] and 1's are on its diagonal, the vector of uniforms U = (Φ(X1),…, Φ(XP)) is obtained, where Φ(x) is the distribution function of a standard normal variable. For main period p, the marginal probability distribution for Ap is assumed to be negative binomial with parameters γp and ρp, γp being a positive number and 0 < ρp < 1. A0 and AP+1, the number of arrivals during the preliminary and the wrap-up periods, respectively, are always 0 for this process.

Since the numbers of arrivals per-period are generated directly, this process does not arise as a Poisson arrival process. However, inter-arrival times are generated as if Ap* = round(BAp) was a Poisson variate. As a result, for each main period, the arrival process generates Ap* uniforms ranging from the beginning to the end of the period, and the uniforms are sorted to get inter-arrival times.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.PoissonUniformArrivalProcess
times
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess
contactEvent
 
Constructor Summary
NORTADrivenArrivalProcess(PeriodChangeEvent pce, ContactFactory factory, DoubleMatrix2D sigma, double[] gammas, double[] probs, RandomStream stream)
          Constructs a new NORTA-driven arrival process with period-change event pce, contact factory factory, correlation matrix sigma, negative binomial parameters (gammas[p], probs[p]), and random number stream stream.
 
Method Summary
 double getExpectedArrivalRate(int p)
          Determines the expected arrival rate in period p for this arrival process assuming that the expected value of the busyness factor is 1.
 double getNegBinGamma(int p)
          Returns the value of γp, the negative binomial double-precision parameter associated with main period p.
 double getNegBinP(int p)
          Returns the value of ρp, the negative binomial double-precision parameter associated with main period p.
 DoubleMatrix2D getSigma()
          Returns the correlation matrix associated with this arrival process.
 void init()
          Initializes the new arrival process.
 void setNegBinParams(int p, double gammap, double rhop)
          Sets the parameters for the negative binomial of period p to γp and ρp.
 void setSigma(DoubleMatrix2D sigma)
          Sets the associated correlation matrix to sigma.
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.PoissonUniformArrivalProcess
computeArrivalTimes, getArrivalRate, getArrivalRate, getArrivals, getExpectedArrivalRate, getPeriodChangeEvent, getStream, nextTime, setArrivals, setStream, toString
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess
addNewContactListener, clearNewContactListeners, getArrivalRates, getBusynessFactor, getContactFactory, getExpectedArrivalRateB, getExpectedArrivalRateB, getExpectedArrivalRates, getExpectedArrivalRatesB, getExpectedBusynessFactor, getName, getNewContactListeners, getNextArrivalTime, init, isStarted, notifyNewContact, removeNewContactListener, setBusynessFactor, setContactFactory, setExpectedBusynessFactor, setName, setSimulator, simulator, start, start, startStationary, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NORTADrivenArrivalProcess

public NORTADrivenArrivalProcess(PeriodChangeEvent pce,
                                 ContactFactory factory,
                                 DoubleMatrix2D sigma,
                                 double[] gammas,
                                 double[] probs,
                                 RandomStream stream)
Constructs a new NORTA-driven arrival process with period-change event pce, contact factory factory, correlation matrix sigma, negative binomial parameters (gammas[p], probs[p]), and random number stream stream.

Parameters:
pce - the period-change event defining the periods.
factory - the contact factory instantiating contacts.
sigma - the correlation matrix.
gammas - the γ parameters for negative binomials.
probs - the ρ parameters for negative binomials.
stream - the random number stream for correlated negative binomial vectors and uniform arrival times.
Throws:
NullPointerException - if one argument is null.
IllegalArgumentException - if the dimensions of the correlation matrix does not correspond to P×P, or the length of ns or probs do not correspond to number of main periods P.
Method Detail

getSigma

public DoubleMatrix2D getSigma()
Returns the correlation matrix associated with this arrival process.

Returns:
the associated correlation matrix.

setSigma

public void setSigma(DoubleMatrix2D sigma)
Sets the associated correlation matrix to sigma.

Parameters:
sigma - the new correlation matrix.
Throws:
NullPointerException - if sigma is null.
IllegalArgumentException - if sigma is not a P×P symmetric and positive-definite matrix.

getNegBinGamma

public double getNegBinGamma(int p)
Returns the value of γp, the negative binomial double-precision parameter associated with main period p.

Parameters:
p - the main period index.
Returns:
the value of γp.
Throws:
ArrayIndexOutOfBoundsException - if p is negative or greater than or equal to P.

getNegBinP

public double getNegBinP(int p)
Returns the value of ρp, the negative binomial double-precision parameter associated with main period p.

Parameters:
p - the main period index.
Returns:
the value of ρp.
Throws:
ArrayIndexOutOfBoundsException - if p is negative or greater than or equal to P.

setNegBinParams

public void setNegBinParams(int p,
                            double gammap,
                            double rhop)
Sets the parameters for the negative binomial of period p to γp and ρp.

Parameters:
p - the index of the main period.
gammap - the new value of γp.
rhop - the new value of ρp.
Throws:
ArrayIndexOutOfBoundsException - if p is negative or greater than or equal to P.
IllegalArgumentException - if the negative binomial parameters are invalid.

init

public void init()
Description copied from class: ContactArrivalProcess
Initializes the new arrival process. If this method is overridden by a subclass, it is important to call super.init() in order to ensure that everything is initialized correctly.

Specified by:
init in interface ContactSource
Specified by:
init in interface Initializable
Overrides:
init in class PoissonUniformArrivalProcess

getExpectedArrivalRate

public double getExpectedArrivalRate(int p)
Description copied from class: ContactArrivalProcess
Determines the expected arrival rate in period p for this arrival process assuming that the expected value of the busyness factor is 1. The arrival rate corresponds to the expected number of arrivals per simulation time unit during the specified period; one must multiply the rate by the period duration to get the expected number of arrivals during the period. If arrival rates are deterministic, this returns the same value as ContactArrivalProcess.getArrivalRate(int).

If $ \E$[B]≠1, one should use ContactArrivalProcess.getExpectedArrivalRateB(int) which takes the expectation of the busyness factor into account.

If the expected arrival rate is not available, throws an UnsupportedOperationException. This is the default behavior of this method if not overridden by a subclass.

Overrides:
getExpectedArrivalRate in class PoissonUniformArrivalProcess
Parameters:
p - the queried period index.
Returns:
the expected arrival rate in that period.

ContactCenters
V. 0.9.9.

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