|
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
public class PoissonUniformArrivalProcess
This arrival process can be used when the number of
arrivals per period Ap is known (when B = 1). By default,
for each period p,
Ap* = round(BAp)
uniforms are generated and sorted
in increasing order to get the inter-arrival times,
supposing we have a Poisson process with stationary increments.
Because this algorithm requires the duration of each period,
arrivals are not allowed during the wrap-up period,
which has a random duration not known at the
time arrivals are generated.
The algorithm for generating arrival times can be
customized by overriding computeArrivalTimes()
.
The number of arrivals, constant by default, can also be
changed between replications.
Field Summary | |
---|---|
protected DoubleArrayList |
times
Array list containing the arrival times of contacts. |
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess |
---|
contactEvent |
Constructor Summary | |
---|---|
PoissonUniformArrivalProcess(PeriodChangeEvent pce,
ContactFactory factory,
int[] arrivals,
RandomStream stream)
Constructs a new arrival process with known number of arrivals in each period. |
Method Summary | |
---|---|
protected void |
computeArrivalTimes()
This is called by init() to compute the arrival times
based on the number of arrivals in each period. |
double |
getArrivalRate(double st,
double et)
Computes the arrival rate using the period-change event returned by getPeriodChangeEvent()
to determine the boundaries of periods, and
the arrival rates returned by
getArrivalRate(int) . |
double |
getArrivalRate(int p)
Determines the arrival rate in period p for this arrival process. |
int[] |
getArrivals()
Returns the number of arrivals for each period. |
double |
getExpectedArrivalRate(double st,
double et)
Computes the expected arrival rate using the period-change event returned by getPeriodChangeEvent()
to determine the boundaries of periods, and
the expected arrival rates returned by
getExpectedArrivalRate(int) . |
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. |
PeriodChangeEvent |
getPeriodChangeEvent()
Returns the period-change event associated with this object. |
RandomStream |
getStream()
Returns the random number stream used to generate uniforms. |
void |
init()
Initializes the new arrival process. |
double |
nextTime()
Computes and returns the time before the next contact arrival is simulated by this object. |
void |
setArrivals(int[] arrivals)
Sets the number of arrivals in each period to arrivals. |
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.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 |
Field Detail |
---|
protected DoubleArrayList times
Constructor Detail |
---|
public PoissonUniformArrivalProcess(PeriodChangeEvent pce, ContactFactory factory, int[] arrivals, RandomStream stream)
pce
- the period-change event defining the periods.factory
- the contact factory used to create contacts.arrivals
- the mean number of arrivals in each period.stream
- the random number stream for the uniforms.
IllegalArgumentException
- if there is not a mean number
of arrivals for each period.
NullPointerException
- if any argument is null.Method Detail |
---|
public RandomStream getStream()
public void setStream(RandomStream stream)
stream
- the new random number stream.
NullPointerException
- if stream is null.public PeriodChangeEvent getPeriodChangeEvent()
public double getArrivalRate(int p)
ContactArrivalProcess
If arrival rate is random, this returns the arrival rate
for the current replication.
One should use ContactArrivalProcess.getExpectedArrivalRate(int)
or ContactArrivalProcess.getExpectedArrivalRateB(int)
to get the
expected arrival rate.
If the arrival rate is not available,
throws an UnsupportedOperationException
.
getArrivalRate
in class ContactArrivalProcess
p
- the queried period index.
public double getArrivalRate(double st, double et)
getPeriodChangeEvent()
to determine the boundaries of periods, and
the arrival rates returned by
getArrivalRate(int)
.
getArrivalRate
in class ContactArrivalProcess
st
- the starting time s.et
- the ending time e.
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 ContactArrivalProcess
p
- the queried period index.
public double getExpectedArrivalRate(double st, double et)
getPeriodChangeEvent()
to determine the boundaries of periods, and
the expected arrival rates returned by
getExpectedArrivalRate(int)
.
getExpectedArrivalRate
in class ContactArrivalProcess
st
- the starting time s.et
- the ending time e.
public int[] getArrivals()
public void setArrivals(int[] arrivals)
arrivals
- the number of arrivals.
NullPointerException
- if the array is null.
IllegalArgumentException
- if the length of the given
array does not correspond to the number of periods
as defined by getPeriodChangeEvent()
.public void init()
ContactArrivalProcess
init
in interface ContactSource
init
in interface Initializable
init
in class ContactArrivalProcess
protected void computeArrivalTimes()
init()
to compute the arrival times
based on the number of arrivals in each period.
The arrival times must be stored in the array list times
, which
is empty at the time the method is called. The arrival times in
the list are assumed to be sorted in increasing order after
the method returns.
The method should use the random stream returned
by getStream()
to generate
the random numbers.
By default, for each period p = 0,…, P (preliminary and main periods), this generates Ap* uniforms in [tp-1, tp), where t-1 = 0, Ap is the expected number of arrivals in period p, and tp is the ending time of period p. The generated arrival times are then sorted. If B = 1, Ap* = Ap, otherwise Ap* = round(ApB).
public double nextTime()
ContactArrivalProcess
nextTime
in class ContactArrivalProcess
public String toString()
toString
in class ContactArrivalProcess
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |