|
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.PoissonArrivalProcess
umontreal.iro.lecuyer.contactcenters.contact.PiecewiseConstantPoissonArrivalProcess
umontreal.iro.lecuyer.contactcenters.contact.PoissonGammaNortaRatesArrivalProcess
public class PoissonGammaNortaRatesArrivalProcess
Represents a doubly-stochastic Gamma-Poisson process with piecewise-constant
randomized correlated arrival rates. The base arrival rates λp are
constant during each period, but they are not deterministic: for period p,
the base rate of the Poisson process is defined as a correlated gamma random
variable. The marginal distribution of the rate is gamma with shape parameter
αG, p, and scale parameter
λG, p (mean
αG, p/λG, p). The correlation structure
is modelled using Normal copula model with positive definite correlation
matrix
having elements in [- 1, 1]. If
αG, p
or
λG, p are 0, the resulting arrival rate during period
p is always 0. As with the Poisson process with deterministic arrival
rates, the generated base arrival rates are multiplied by a busyness factor
B to get the arrival rates. Because the values of
λ(t) are
generated once for a replication, in the
init()
method, not calling
this method before the simulation starts could lead to unpredictable arrival
rates.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.PiecewiseConstantPoissonArrivalProcess |
---|
busyGen, s_bgammaParam, s_numMC, varianceEpsilon |
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess |
---|
contactEvent |
Constructor Summary | |
---|---|
PoissonGammaNortaRatesArrivalProcess(PeriodChangeEvent pce,
ContactFactory factory,
double[] galphas,
double[] glambdas,
double[][] CorrMtx,
RandomStream stream,
RandomStream busynessStream)
Constructs a new Poisson-gamma arrival process using factory to instantiate contacts. |
Method Summary | |
---|---|
RandomStream |
getBusynessStream()
Returns the random stream used to generate the busyness factors for the Poisson arrival process. |
double |
getExpectedArrivalRate(double st,
double et)
Determines the expected mean arrival rate in time interval [s, e] for this arrival process assuming that the expected value of the busyness factor is 1. |
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[] |
getGammaAlphas()
Returns the parameters αG, p for the gamma rates. |
double[] |
getGammaLambdas()
Returns the λp parameters for the arrivals rates. |
static PoissonGammaNortaRatesArrivalProcess |
getInstanceFromMLE(PeriodChangeEvent pce,
ContactFactory factory,
RandomStream stream,
RandomStream busynessStreams,
int[][] arrivals,
int numObs,
int numPeriods,
int numMC,
CorrelationFit fit)
Constructs a new arrival process with gamma arrival rates estimated by the maximum likelihood method based on the numObs observations in array arrivals. |
static double[] |
getMLE(int[][] arrivals,
int numObs,
int numPeriods,
int numMC,
CorrelationFit fit,
double[][] corr)
Estimates the parameters of a Poisson-gamma-norta-rates arrival process from the number of arrivals in the array arrivals. |
double[][] |
getSigma()
Returns the correlation matrix associated with this arrival process. |
void |
init()
Initializes the new arrival process. |
void |
setBusynessStream(RandomStream busynessStream)
Changes the random stream used to generate the busyness factors for the Poisson arrival process. |
void |
setGammaParams(double[] galphas,
double[] glambdas)
Sets the αG, p and λp parameters for the gamma arrival rates to galphas and glambdas, respectively. |
void |
setSigma(double[][] CorrMtx)
Sets the associated correlation matrix to CorrMtx. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.PiecewiseConstantPoissonArrivalProcess |
---|
changePeriod, getArrivalRate, getArrivalRate, getInstanceFromMLE, getLambdas, getMLE, getMLENegMulti, getNumMC, getPeriodChangeEvent, getVarianceEpsilon, isNormalizing, setLambdas, setNormalizing, setNumMC, setVarianceEpsilon, startStationary, stop |
Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.PoissonArrivalProcess |
---|
clearCache, getGenWithCache, getInstanceFromMLE, getLambda, getStream, initCache, isCaching, nextTime, setCaching, setLambda, setStream |
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, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PoissonGammaNortaRatesArrivalProcess(PeriodChangeEvent pce, ContactFactory factory, double[] galphas, double[] glambdas, double[][] CorrMtx, RandomStream stream, RandomStream busynessStream)
pce
- the period-change event associated with this object.factory
- the factory creating contacts for this generator.galphas
- the
αG, p parameters of the gamma variates.glambdas
- the
λG, p parameters of the gamma variates.CorrMtx
- the correlation matrix of the Normal copula model for rates.stream
- random number stream for the exponential variates.busynessStream
- random number stream for the busyness factor.
IllegalArgumentException
- if there is not one rate for each period.
NullPointerException
- if any argument is null.Method Detail |
---|
public double[] getGammaAlphas()
public double[] getGammaLambdas()
public void setGammaParams(double[] galphas, double[] glambdas)
galphas
- the new
αG, p parameters.glambdas
- the new
λp parameters.
NullPointerException
- if the given arrays are null.
IllegalArgumentException
- if the length of the given arrays does not correspond to at
least the number of periods.public double[][] getSigma()
public void setSigma(double[][] CorrMtx)
CorrMtx
- the new sigma correlation matrix.
NullPointerException
- if CorrMtx is null.
IllegalArgumentException
- if CorrMtx is not a P×P symmetric and
positive-definite matrix.public RandomStream getBusynessStream()
public void setBusynessStream(RandomStream busynessStream)
busynessStream
- random number generator for the λp values.
NullPointerException
- if the parameter is null.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 PiecewiseConstantPoissonArrivalProcess
p
- the queried period index.
public double getExpectedArrivalRate(double st, double et)
ContactArrivalProcess
ContactArrivalProcess.getArrivalRate(double,double)
.
If
λ(t) is the arrival rate at time t, this
method returns
If
[B]≠1, one should use
ContactArrivalProcess.getExpectedArrivalRateB(double,double)
which takes the expectation of the busyness factor into account.
This method returns 0 if e≤s.
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 PiecewiseConstantPoissonArrivalProcess
st
- the starting time s.et
- the ending time e.
public void init()
ContactArrivalProcess
init
in interface ContactSource
init
in interface Initializable
init
in class PiecewiseConstantPoissonArrivalProcess
public String toString()
toString
in class PiecewiseConstantPoissonArrivalProcess
public static double[] getMLE(int[][] arrivals, int numObs, int numPeriods, int numMC, CorrelationFit fit, double[][] corr)
arrivals
- the number of arrivals during each day and period.numObs
- the number of days.numPeriods
- the number of periods.numMC
- the number of MonteCarlo samples used in the estimation.fit
- type of fit used to compute the correlation matrix.corr
- the estimated correlation matrix is returned in corr.
public static PoissonGammaNortaRatesArrivalProcess getInstanceFromMLE(PeriodChangeEvent pce, ContactFactory factory, RandomStream stream, RandomStream busynessStreams, int[][] arrivals, int numObs, int numPeriods, int numMC, CorrelationFit fit)
getMLE(int[][],int,int,int,CorrelationFit,double[][])
. For
the preliminary period, the parameters of the first main period are used.
For the wrap-up periods, both parameters are set to 0; as a result, the
arrival rate is always 0 during the wrap-up period.
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.busynessStreams
- the random stream to generate busyness factors.arrivals
- the number of arrivals.numObs
- the number of days.numPeriods
- the number of periods.numMC
- the number of MonteCarlo samples used in the estimation.fit
- type of fit used to compute the correlation matrix.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |