|
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.contact.ContactArrivalProcess
umontreal.iro.lecuyer.contactcenters.contact.PoissonUniformArrivalProcess
umontreal.iro.lecuyer.contactcenters.contact.DirichletArrivalProcess
public class DirichletArrivalProcess
Represents an arrival process where the number of arrivals are spread in periods using a Dirichlet distribution [3]. Let's define the vector of ratios
At the beginning of each replication,
A is generated from a probability
distribution such as gamma. A vector
Q is then generated
from a Dirichlet distribution [12] with parameters
(α1,…, αP). Each component of
Q
is multiplied with A to get
before
the vector
A is obtained by rounding each
component of
to the nearest integer.
Since per-period numbers of arrivals are generated directly rather than through arrival rates, this process does not arise as a Poisson arrival process. However, inter-arrival times are generated as if the Ap* = round(BAp) were Poisson variates. 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 | |
---|---|
DirichletArrivalProcess(PeriodChangeEvent pce,
ContactFactory factory,
double[] alphas,
RandomStream stream,
RandomVariateGen agen)
Constructs a new Dirichlet arrival process with period-change event pce, contact factory factory, Dirichlet parameters alphas, random number stream stream, and generator agen for the number of arrivals. |
Method Summary | |
---|---|
double |
getAlpha(int p)
Returns the value of the αp parameter for the Dirichlet distribution. |
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. |
static DirichletArrivalProcess |
getInstanceFromMLE(PeriodChangeEvent pce,
ContactFactory factory,
RandomStream stream,
RandomStream streamArr,
Class<? extends Distribution> aDistClass,
int[][] arrivals,
int numObs,
int numPeriods)
Similar to getInstanceFromMLE(PeriodChangeEvent,ContactFactory,RandomStream,RandomVariateGen,int[][],int,int) ,
but also estimates the parameters for A. |
static DirichletArrivalProcess |
getInstanceFromMLE(PeriodChangeEvent pce,
ContactFactory factory,
RandomStream stream,
RandomVariateGen agen,
int[][] arrivals,
int numObs,
int numPeriods)
Constructs a new arrival process with Dirichlet parameters estimated by the maximum likelihood method based on the numObs observations in array arrivals. |
static double[] |
getMLE(int[][] arrivals,
int numObs,
int numPeriods)
Estimates the Dirichlet parameters of an arrival process from the number of arrivals in the array arrivals. |
RandomVariateGen |
getNumArrivalsGenerator()
Returns the random variate generator used for the total number of arrivals A. |
void |
init()
Initializes the new arrival process. |
void |
initWithFixedA(double a)
Initializes the number of arrivals with a fixed A a. |
void |
setAlphas(double[] alphas)
Sets the Dirichlet parameters αp for this object. |
void |
setNumArrivalsGenerator(RandomVariateGen agen)
Changes the random variate generator for the number of arrivals to agen. |
void |
setStream(RandomStream stream)
Sets the random number stream to stream for generating uniforms. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.PoissonUniformArrivalProcess |
---|
computeArrivalTimes, getArrivalRate, getArrivalRate, getArrivals, getExpectedArrivalRate, getPeriodChangeEvent, getStream, nextTime, setArrivals |
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 |
---|
public DirichletArrivalProcess(PeriodChangeEvent pce, ContactFactory factory, double[] alphas, RandomStream stream, RandomVariateGen agen)
pce
- the period change event.factory
- the contact factory instantiating contacts.alphas
- the parameters of the Dirichlet distribution.stream
- the random number stream for Dirichlet vectors
and uniform arrival times.agen
- the random variate generator for the number of arrivals.
IllegalArgumentException
- if there is not an α value
for each main period, or if one α value is negative or 0.
NullPointerException
- if one argument is null.Method Detail |
---|
public RandomVariateGen getNumArrivalsGenerator()
public void setNumArrivalsGenerator(RandomVariateGen agen)
agen
- the new random variate generator for the number of arrivals.
NullPointerException
- if the parameter is null.public double getAlpha(int p)
p
- the index of the parameter.
public void setStream(RandomStream stream)
PoissonUniformArrivalProcess
setStream
in class PoissonUniformArrivalProcess
stream
- the new random number stream.public void setAlphas(double[] alphas)
alphas
- a new vector of parameters.
IllegalArgumentException
- if the length of alphas
does not correspond to the number of main periods or if
one of the α parameter is negative or 0.
NullPointerException
- if alphas is null.public void initWithFixedA(double a)
a
- the total number of arrivals.
IllegalArgumentException
- if a is negative or 0.public void init()
ContactArrivalProcess
init
in interface ContactSource
init
in interface Initializable
init
in class PoissonUniformArrivalProcess
public String toString()
toString
in class PoissonUniformArrivalProcess
public double getExpectedArrivalRate(int p)
ContactArrivalProcess
ContactArrivalProcess.getArrivalRate(int)
.
If
[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.
getExpectedArrivalRate
in class PoissonUniformArrivalProcess
p
- the queried period index.
public static double[] getMLE(int[][] arrivals, int numObs, int numPeriods)
arrivals
- the number of arrivals during each day and period.numObs
- the number of days.numPeriods
- the number of periods.
public static DirichletArrivalProcess getInstanceFromMLE(PeriodChangeEvent pce, ContactFactory factory, RandomStream stream, RandomVariateGen agen, int[][] arrivals, int numObs, int numPeriods)
getMLE(int[][],int,int)
.
pce
- the period-change event marking the end of periods.factory
- the contact factory used to create contacts.stream
- the random stream to generate arrival times.agen
- the random variate generator for A.arrivals
- the number of arrivals.numObs
- the number of days.numPeriods
- the number of periods.
parameter is estimated in addition to the arrival rates.
public static DirichletArrivalProcess getInstanceFromMLE(PeriodChangeEvent pce, ContactFactory factory, RandomStream stream, RandomStream streamArr, Class<? extends Distribution> aDistClass, int[][] arrivals, int numObs, int numPeriods)
getInstanceFromMLE(PeriodChangeEvent,ContactFactory,RandomStream,RandomVariateGen,int[][],int,int)
,
but also estimates the parameters for A.
This method accepts a class object aDistClass
which is the guessed probability distribution of A.
It uses DistributionFactory
to get an
instance of the distribution (with estimated parameters),
and constructs the arrival process by
using this distribution, and the Dirichlet parameters
estimated by getMLE(int[][],int,int)
.
pce
- the period-change event marking the end of periods.factory
- the contact factory used to create contacts.stream
- the random stream to generate arrival times.streamArr
- the random stream for A.aDistClass
- the class of the probability distribution of A.arrivals
- the number of arrivals.numObs
- the number of days.numPeriods
- the number of periods.
parameter is estimated in addition to the arrival rates.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |