Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.contactcenters.contact
Class PoissonArrivalProcessWithTimeIntervals

    java.lang.Object
      umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess
          umontreal.iro.lecuyer.contactcenters.contact.PoissonArrivalProcess
              umontreal.iro.lecuyer.contactcenters.contact.PoissonArrivalProcessWithTimeIntervals

All Implemented Interfaces:
  ContactSource, Initializable, Named, ToggleElement

    public class PoissonArrivalProcessWithTimeIntervals

extends PoissonArrivalProcess

Represents a Poisson arrival process with piecewise-constant arrival rates that can change at arbitrary moments during the simulation. This process is similar to `PiecewiseConstantPoissonArrivalProcess`, except the times arrival rates change do not need to correspond to main periods. More specifically, let t0 < ... < tL be an increasing sequence of simulation times, and let Bλj, for j = 0,…, L - 1, be the arrival rate during time interval [tj, tj+1). The arrival rate is 0 for t < t0 and t≥tL.

Field Summary

Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.ContactArrivalProcess
`contactEvent`

Constructor Summary
`PoissonArrivalProcessWithTimeIntervals(ContactFactory factory, double[] times, double[] lambdas, RandomStream stream)` Calls `PoissonArrivalProcessWithTimeIntervals` `(Simulator.getDefaultSimulator(), factory, times, lambdas, stream)`.
`PoissonArrivalProcessWithTimeIntervals(Simulator sim, ContactFactory factory, double[] times, double[] lambdas, RandomStream stream)` Constructs a new arrival process using the simulator `sim`, the contact factory `factory` for creating contacts, times t0,…, tL in array `times`, and arrival rates in array `lambdas`.

Method Summary
`double` | `getArrivalRate(double st, double et)` Determines the mean arrival rate in time interval [s, e].
`double[]` | `getArrivalRatesInt()` Similar to `ContactArrivalProcess.getArrivalRates(double[])`, for the arrival rates per interval.
`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[]` | `getExpectedArrivalRatesBInt()` Similar to `ContactArrivalProcess.getExpectedArrivalRatesB(double[])`, for the arrival rates per interval.
`double[]` | `getExpectedArrivalRatesInt()` Similar to `ContactArrivalProcess.getExpectedArrivalRates(double[])`, for the arrival rates per interval.
`double[]` | `getTimes()` Returns the array of times containing t0,…, tL.
`void` | `init()` Initializes the new arrival process.
`boolean` | `isNormalizing()` Determines if the base arrival rates are normalized with length of intervals.
`void` | `setNormalizing(boolean b)` Sets the arrival rates normalization indicator to `b`.
`void` | `start()` Enables the element represented by this object.
`void` | `startStationary()` This method calls `ContactArrivalProcess.start()` assuming that the λ arrival rate will not change during simulation.
`void` | `stop()` Disables the element represented by this object.

Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.PoissonArrivalProcess
`clearCache, getArrivalRate, getExpectedArrivalRate, getGenWithCache, getInstanceFromMLE, getLambda, getMLE, getStream, initCache, isCaching, nextTime, setCaching, setLambda, 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`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PoissonArrivalProcessWithTimeIntervals

    public PoissonArrivalProcessWithTimeIntervals(ContactFactory factory,
                                                  double[] times,
                                                  double[] lambdas,
                                                  RandomStream stream)

  Calls `PoissonArrivalProcessWithTimeIntervals` `(Simulator.getDefaultSimulator(), factory, times, lambdas, stream)`.

### PoissonArrivalProcessWithTimeIntervals

    public PoissonArrivalProcessWithTimeIntervals(Simulator sim,
                                                  ContactFactory factory,
                                                  double[] times,
                                                  double[] lambdas,
                                                  RandomStream stream)

  Constructs a new arrival process using the simulator `sim`, the contact factory `factory` for creating contacts, times t0,…, tL in array `times`, and arrival rates in array `lambdas`. Inter-arrival times are generated using the random stream `stream`.

  Parameters:
    `sim` - the simulator used to schedule events.
    `factory` - the factory creating contacts for this arrival process.
    `times` - the sequence of times at which arrival rate changes.
    `lambdas` - the arrival rates.
    `stream` - the random stream for inter-arrival times.
  Throws:
    `NullPointerException` - if any argument is `null`.
    `IllegalArgumentException` - if `lambdas.length` is smaller than 1, or if `times.length` does not correspond to `lambdas.length` plus 1, or if `times` is not an increasing sequence of numbers.

Method Detail

### isNormalizing

    public boolean isNormalizing()

  Determines if the base arrival rates are normalized with length of intervals. When normalization is enabled, for interval tj+1 - tj, the effective base arrival rate is λj/(tj+1 - tj). If normalization is disabled (the default), the base arrival rates are used as specified.

  Returns:
    if the arrival process normalizes base arrival rates.

### setNormalizing

    public void setNormalizing(boolean b)

  Sets the arrival rates normalization indicator to `b`.

  Parameters:
    `b` - the new arrival rate normalization indicator.
  See Also:
    `isNormalizing()`

### getTimes

    public double[] getTimes()

  Returns the array of times containing t0,…, tL.

  Returns:
    the array of times.

### getArrivalRatesInt

    public double[] getArrivalRatesInt()

  Similar to `ContactArrivalProcess.getArrivalRates(double[])`, for the arrival rates per interval.

### getExpectedArrivalRatesInt

    public double[] getExpectedArrivalRatesInt()

  Similar to `ContactArrivalProcess.getExpectedArrivalRates(double[])`, for the arrival rates per interval.

### getExpectedArrivalRatesBInt

    public double[] getExpectedArrivalRatesBInt()

  Similar to `ContactArrivalProcess.getExpectedArrivalRatesB(double[])`, for the arrival rates per interval.

### 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

  [λ(t)]dt/(e - s).

  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.

  Overrides:
    `getExpectedArrivalRate` in class `PoissonArrivalProcess`
  Parameters:
    `st` - the starting time s.
    `et` - the ending time e.
  Returns:
    the expected arrival rate in the given time interval.

### 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

  λ(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 e≤s.

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

### 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 `PoissonArrivalProcess`

### startStationary

    public void startStationary()

  Description copied from class: `PoissonArrivalProcess`
  This method calls `ContactArrivalProcess.start()` assuming that the λ arrival rate will not change during simulation. Subclasses violating this assumption should override this method.

  Overrides:
    `startStationary` in class `PoissonArrivalProcess`

### start

    public void start()

  Description copied from interface: `ToggleElement`
  Enables the element represented by this object. This method throws an `IllegalStateException` if the element is already enabled.

  Specified by:
    `start` in interface `ToggleElement`
  Overrides:
    `start` in class `ContactArrivalProcess`

### stop

    public void stop()

  Description copied from interface: `ToggleElement`
  Disables the element represented by this object. This method throws an `IllegalStateException` if the element is already disabled.

  Specified by:
    `stop` in interface `ToggleElement`
  Overrides:
    `stop` in class `ContactArrivalProcess`

Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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