ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.contact
Class StationaryContactArrivalProcess

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

public class StationaryContactArrivalProcess
extends ContactArrivalProcess

Defines a contact arrival process with inter-arrival times following a stationary distribution. When an inter-arrival time is required, a random variate generator is used to get a random value.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess
contactEvent
 
Constructor Summary
StationaryContactArrivalProcess(ContactFactory factory, RandomVariateGen timesGen)
          Constructs a new contact arrival process creating contacts using the given factory and using timesGen to generate the inter-arrival times.
StationaryContactArrivalProcess(Simulator sim, ContactFactory factory, RandomVariateGen timesGen)
          Equivalent to StationaryContactArrivalProcess(ContactFactory,RandomVariateGen), using the given simulator sim.
 
Method Summary
 double getArrivalRate(double st, double et)
          Determines the mean arrival rate in time interval [s, e].
 double getArrivalRate(int p)
          Determines the arrival rate in period p for this 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.
 RandomVariateGen getTimesGen()
          Returns the random variate generator used to generate the times between each arrival.
 double nextTime()
          Computes and returns the time before the next contact arrival is simulated by this object.
 void setTimesGen(RandomVariateGen timesGen)
          Sets the random variate generator for inter-arrival times to timesGen.
 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, 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

StationaryContactArrivalProcess

public StationaryContactArrivalProcess(ContactFactory factory,
                                       RandomVariateGen timesGen)
Constructs a new contact arrival process creating contacts using the given factory and using timesGen to generate the inter-arrival times.

Parameters:
factory - the factory creating contacts for this arrival process.
timesGen - the random variate generator used to generate times between arrivals.

StationaryContactArrivalProcess

public StationaryContactArrivalProcess(Simulator sim,
                                       ContactFactory factory,
                                       RandomVariateGen timesGen)
Equivalent to StationaryContactArrivalProcess(ContactFactory,RandomVariateGen), using the given simulator sim.

Method Detail

getTimesGen

public RandomVariateGen getTimesGen()
Returns the random variate generator used to generate the times between each arrival.

Returns:
the random variate generator associated with this object.

setTimesGen

public void setTimesGen(RandomVariateGen timesGen)
Sets the random variate generator for inter-arrival times to timesGen.

Parameters:
timesGen - the new random variate generator.
Throws:
NullPointerException - if timesGen is null.

getArrivalRate

public double getArrivalRate(int p)
Description copied from class: ContactArrivalProcess
Determines the arrival rate in period p for this arrival process. 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 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.

Overrides:
getArrivalRate in class ContactArrivalProcess
Parameters:
p - the queried period index.
Returns:
the arrival rate in that period.

getArrivalRate

public double getArrivalRate(double st,
                             double et)
Description copied from class: ContactArrivalProcess
Determines the mean arrival rate in time interval [s, e]. The arrival rate corresponds to the expected number of arrivals per simulation time unit during the specified interval; one must multiply the rate by the interval length to get the expected number of arrivals during the interval. If λ(t) is the arrival rate at time t, this method returns the result of

$\displaystyle \htint_{s}^{e}$λ(t)dt/(e - s).

If arrival rate is random, this returns the arrival rate for the current replication. One should use ContactArrivalProcess.getExpectedArrivalRate(double,double) or ContactArrivalProcess.getExpectedArrivalRateB(double,double) to get the expected arrival rate.

This method returns 0 if es.

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

Overrides:
getArrivalRate in class ContactArrivalProcess
Parameters:
st - the starting time s.
et - the ending time e.
Returns:
the arrival rate in the given time interval.

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 ContactArrivalProcess
Parameters:
p - the queried period index.
Returns:
the expected arrival rate in that period.

getExpectedArrivalRate

public double getExpectedArrivalRate(double st,
                                     double et)
Description copied from class: ContactArrivalProcess
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. The arrival rate corresponds to the expected number of arrivals per simulation time unit during the specified interval; one must multiply the rate by the interval length to get the expected number of arrivals during the interval. If arrival rates are deterministic, this returns the same value as ContactArrivalProcess.getArrivalRate(double,double). If λ(t) is the arrival rate at time t, this method returns

$\displaystyle \htint_{s}^{e}$$\displaystyle \E$[λ(t)]dt/(e - s).

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

This method returns 0 if es.

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 ContactArrivalProcess
Parameters:
st - the starting time s.
et - the ending time e.
Returns:
the expected arrival rate in the given time interval.

nextTime

public double nextTime()
Description copied from class: ContactArrivalProcess
Computes and returns the time before the next contact arrival is simulated by this object. If this method returns Double.POSITIVE_INFINITY, no more arrival events will be scheduled until the arrival process is reinitialized.

Specified by:
nextTime in class ContactArrivalProcess
Returns:
the time before the next arrival.

toString

public String toString()
Overrides:
toString in class ContactArrivalProcess

ContactCenters
V. 0.9.9.

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