Sie sind auf Seite 1von 64

OR 542 Stochastic Models

Dr. Daliborka Stanojevi dstanoje@gmu.edu


1

Today

Queuing Theory Reading: Chapter 20, Sections: 1- 11 (Winston 4th Edition)


Recommended optional reading (if interested in alternative presentation of the topic):

Introduction to Probability Models, Sheldon M. Ross, Academic Press Stochastic Processes, Sheldon M. Ross, Wiley Stochastic Modeling and the Theory of Queues, Ronald W. Wolf, Prentice Hall

Description

Each of us has spent a great deal of time waiting in lines. Queueing theory deals with mathematical models for waiting lines, or queues.

Queueing Theory

Some Queuing Terminology

To describe a queuing system, an input process and an output process must be specified. Examples of input and output processes are:
Situation Bank Input Process Customers arrive at bank Request for pizza delivery are received Output Process Tellers serve the customers Pizza parlor send out truck to deliver pizzas

Pizza parlor

The Input or Arrival Process


The input process is usually called the arrival process. Arrivals are called customers. We assume that no more than one arrival can occur at a given instant. If more than one arrival can occur at a given instant, we say that bulk arrivals are allowed. Models in which arrivals are drawn from a small population are called finite source models. If a customer arrives but fails to enter the system, we say that the customer has balked.
6

Arrival Process

Probability Distribution of Arrivals over time

Usually Poisson Process


Number of Arrivals in time interval ~ Poisson Time between arrivals ~ Exponential Memoryless Property

Deterministic General Distribution

Single or simultaneous arrivals (batch or bulk) Behavior of arrivals


Impatience (Balking or Reneging) Jockeying

Time behavior of system (Stationary or not) Capacity limits


7

The Output or Service Process

To describe the output process of a queuing system, we usually specify a probability distribution the service time distribution which governs a customers service time. We study two arrangements of servers: servers in parallel and servers in series. Servers are in parallel if all server provide the same type of service and a customer need only pass through one server to complete service. Servers are in series if a customer must pass through several servers before completing service.
8

The Output or Service Process


Finally we consider priority queuing disciplines. A priority discipline classifies each arrival into one of several categories. Each category is then given a priority level, and within each priority level, customers enter service on an FCFS basis. Another factor that has an important effect on the behavior of a queuing system is the method that customers use to determine which line to join.
9

Service Process

Probability Distribution of Service time


Usually modeled as Exponential General

Single or simultaneous service (bulk or individual) Number of Parallel service channels

.
10

Modeling Arrival and Service Processes


We define ti to be the time at which the ith customer arrives. In modeling the arrival process we assume that the interarrival times Tis are independent, continuous random variables described by the random variable A. The assumption that each interarrival time is governed by the same random variable implies that the distribution of arrivals is independent of the time of day or the day of the week. This is the assumption of stationary interarrival times.

11

Kendal-Lee Notation A/B/x/C/y/z


A = letter for arrival distribution (e.g., m, e, g, d, ) B = letter for service distribution x = number of parallel service channels C = queue discipline (FCFS, LCFS, GD, ) y = number allowed in the system z = size of the customer population
12

Measurement of System Performance

System size
Number

in queue Number in system

Customer waiting times


Time

in queue Time in system

Server idleness
13

Poisson Distribution

For a given , ( > 0 ) , Poisson probability mass function for a random variable X is given by:
x P ( X = x ) = e , x = 0,1,2,..., > 0 x!
E ( X ) = , Var ( X ) =

14

Exponential Distribution

A continuous random variable X is exponentially distributed with parameter , if it has the following probability density function:
f ( x ) = e x , x 0 F ( x) = P ( 0 < X < x ) = 1 e x 1 E( X ) = 1 Var ( X ) = 2
15

Erlang Distribution

A continuous random variable X is Erlang distributed with parameters and k, if it has the following probability density function:

( x ) fk ( x) = e x , x > 0; > 0; k Z + (k 1)!


k 1

E( X ) =
.

Var ( X ) =

k 2

It can be shown that a random variable representing a sum of k i.i.d variables each exponentially distributed with parameter , has an Erlang probability distribution with parameters and k.
16

Poisson Process

Def (Ross): A stochastic process N(t) that represents the total number of arrivals/events that have occurred up to time t is said to be a Poisson process with rate ( > 0), if:

P{ N (t + s ) N ( s ) = n} =

N(0) = 0 The process has independent increments (the number of events that occur in disjoint time intervals are independent) The number of events in any interval of length t is Poisson distributed with mean t. That is: (t ) n

n!

e t , n = 0,1,...., , s, t 0

17

Poisson Process

Alternative Def (Ross): A stochastic process N(t) that represents the total number of arrivals/events that have occurred up to time t is said to be a Poisson process with rate ( > 0), if:
N(0) = 0 The process has

Stationary increments (the distribution of the number of events that occur in any interval of time depends only on the length of the time interval) Independent increments (the number of events that occur in disjoint time intervals are independent)

. P

{ N (h) = 1} = h + o(h)

o ( h) where lim =0 h 0 h

. { N ( h) 2} = o( h) P
18

Modeling Arrival and Service Processes

Stationary interarrival times are often unrealistic, but we may often approximate reality by breaking the time of day into segments. A negative interarrival time is impossible. This allows us to write
P ( A c ) = a (t ) dt and P( A > c) = a(t ) dt
0 c c

We define1/ to be the mean or average interarrival time.


1 = ta (t )dt 0
19

Modeling Arrival and Service Processes

We define to be the arrival rate, which will have units of arrivals per hour. An important questions is how to choose A to reflect reality and still be computationally tractable. The most common choice for A is the exponential distribution.

20

Modeling Arrival and Service Processes - Exponential Distribution

An exponential distribution with parameter has a density f(t) = e-t. We can show that the average or mean for exponentially distributed interarrival time is given by

1 E (A) = exponentially distributed We can also show that (for interarrival time):

1 var A = 2

21

Modeling Arrival and Service Processes - Exponential Distribution

Lemma 1: If A has an exponential distribution, then for all nonnegative values of t and h,

(*)

P ( A > t + h | A t ) = P ( A > h)

A probability density function that satisfies (*) is said to have the no-memory (memoryless) property.
22

Modeling Arrival and Service Processes - Exponential Distribution

The memoryless property of the exponential distribution is important because it implies that if we want to know the probability distribution of the time until the next arrival, then It does not matter how long it has been since the last arrival !!!

23

Relationship between Poisson Distribution and Exponential Distribution

Let the number of arrivals be described by a discrete random variable N that has a Poisson distribution with parameter . That is, for n=0,1,2,, e n
P(N = n) = n! ( n = 0,1,2,...)

Let {An, n1} represent the sequence of interarrival times. What is the probability distribution of An?
24

Relationship between Poisson Distribution and Exponential Distribution in Poisson Process

First, (provided that the number of arrivals follows Poisson distribution with parameter t) notice:

P{ A1 > t} = P{ N (t ) = 0} = e t

The above result implies that A1 has an exponential distribution with mean 1/. What is the probability distribution of A2?
25

Relationship between Poisson Distribution and Exponential Distribution in Poisson Process

To obtain distribution of A2, we can use a conditional probability:


P{ A2 > t | A1 = s} = P{ 0 events in ( s, s + t ] | A1 = s} = P{ 0 events in ( s, s + t ]} = e t (by indep. increm.) (by stationary incr.)

Therefore, we can conclude that A2 also has an exponential distribution with mean 1/. Additionally, because A1 and A2 are independent, the following theorem holds:
26

Relationship between Poisson Distribution and Exponential Distribution in Poisson Process

Theorem: Interarrival times are exponential with parameter if and only if the number of arrivals to occur in an interval of length t follows the Poisson distribution with parameter t.

27

The Birth and Death Process

The birth and death process is a (continuous time) Markov chain with state space {0, 1, }, where all jumps are between adjacent states. (Wolf, 1989) The terminology arises from the study of biological populations (births = incremental increase in population; deaths = incremental decrease in population) Example:
0 1 j j +1

j+1

j+1

j+2

28

Birth-Death Processes
-Terminology

The state of a queuing system at time t is defined by the number of people present in the queuing system at time t. A steady state, or equilibrium probability of state j is denoted by j. The behavior of the queuing system before the steady state is reached is called the transient behavior, and the corresponding transient probabilities are denoted by Pij(t). Note: Pij(t) represents the probability that j people will be in the system at time t, given that i people were in the system at time 0.

29

Birth-Death Processes
-Laws of Motion

Law 1

If the queuing system is in state j at time t then:


The probability of a birth between time t and time t+t is jt+o(t) A birth increases the system state by 1, to j+1 The variable j is called the birth rate in state j (in most queuing systems, a birth is simply an arrival).

Law 2

If the queuing system is in state j at time t then:


The probability of a death between time t and time t+t is jt+o(t) A death decreases the system state by 1, to j-1. The variable j is the death rate in state j (in most queuing systems, a death is a service completion). Note that 0 = 0 must hold, or a negative state could occur.

Law 3

Births and deaths are independent of each other.

30

Birth-Death Processes
- Derivation of Steady-State Probabilities

The key part is to relate (for small t) Pij(t+t) to Pij(t), and to remember that, in the steady state, the rate at which transitions occur into any state i must equal the rate at which transitions occur out of state i. We can then derive a set of so called flow balance equations, or conservation of flow equations for a birth-death process.

j 1 j 1 + j +1 j +1 = j ( j + j ) ( j = 1,2,...)
11 = 00
.
31

Birth-Death Processes
- Derivation of Steady-State Probabilities

If we define

Then,

If

j = j =1

c j is finite, we can solve for 0:

0 =

1 1+ c j
j =1 j=

It can be shown that if

j = j =1

c j is infinite, then no steady-state distribution exists.

The most common reason for a steady-state failing to exist is that the arrival rate is at least as large as the maximum rate at which customers can be served.

32

Littles Law
- Motivation

We are often interested in finding out some of the following system metrics:

L = the average number of customers present in the queuing system Lq = the average number of customers waiting in line Ls = the average number of customers in service W = the average time a customer spends in the system Wq = the average time a customer spends in line Ws = the average time a customer spends in service
33

Littles Law
- Theorem

For any queuing system in which a steady-state distribution exists, the following relations hold: L = W Lq = Wq Ls = Ws

Important note: Parameter used in the Littles Law corresponds to the average number of customers per unit time who actually enter the system.

34

Important Series
For 0 x < 1 1 x = 1 x j =0
j n +1 1 x j x = 1 x j =0 n

(1)

( 2)

(3)

j =0

jx j =

x (1 x) 2
35

Queueing Models considered in this class


M/M/1/GD// M/M/1/GD/c/ M/M/s/GD// M/G//GD// GI/G//GD// M/G/1/GD// Finite Source Models Exponential Queues in Series Open Queueing Models M/G/s/GD/s/
36

The M/M/1/GD// Queuing System

Rate Diagram

Let

, 0 <1

, then:

0 = 1 (0 < 1) j = j (1 ) (0 < 1)
37

The M/M/1/GD// Queuing System


L = j j = j (1 ) = (1 ) j j =
j j =0 j =0 j =0 j = j = j =

= (1 )

= = (1 ) 2 1

Ls = 0 0 + 1( 1 + 2 + ) = 1 0 = 1 (1 ) =

2 Lq = L Ls = = 1 1

38

The M/M/1/GD/c/ Queuing System

Rate Diagram

Lq L W= and Wq = (1 c ) (1 c )
39

The M/M/s/GD// Queuing System

Rate Diagram

40

The M/M/s/GD// Queuing System

Can be modeled as a birth-death process with parameters


j =
( j = 0,1,...)

j = j ( j = 0,1,..., s ) j = s ( j = s + 1, s + 2,...)

Let

= , 0 <1 s

then we can derive the following steady-state probabilities

41

The M/M/s/GD// Queuing System


0 = i =( s 1)
1 ( s ) i ( s ) s + i! s!(1 )

i =0

( s ) j 0 j= ( j = 1,2,...s ) j! ( s ) j 0 j= ( j = s + 1, s + 2,...) j s s! s

42

The M/G//GD// and GI/G//GD// Queuing System

There are many examples of systems in which a customer never has to wait for service to begin. In such a system, the customers entire stay in the system may be thought of as his or her service time. Since a customer never has to wait for service, there is, in essence, a server available for each arrival, and we may think of such a system as an infinite-server (or selfservice).

43

The M/G//GD// and GI/G//GD// Queuing System

Using Kendall-Lee notation, an infinite server system in which interarrival and service times may follow arbitrary probability distributions may be written as GI/G//GD// queuing system. Such a system operates as follows:

Interarrival times are iid with common distribution A. Define E(A) = 1/. Thus is the arrival rate. When a customer arrives, he or she immediately enters service. Each customers time in the system is governed by a distribution S having E(S)= 1/.
44

The M/G//GD// and GI/G//GD// Queuing System

Let L be the expected number of customers in the system in the steady state, and W be the expected time that a customer spends in the system. Since W= 1/, Littles formula yields the following relationship that does not require any assumptions of exponentiality:

L=

If interarrival times are exponential, it can be shown that the steady-state probability that j customers are present follows a Poisson distribution with mean

In other words:

45

The M/G/1/GD// Queuing System

Let () be the arrival rate (assumed to be measured in arrivals per hour). Also define 1/ = E(S) and 2=var S. An M/G/1/GD// queuing system is not a birth-death process! Determination of the steady-state probabilities for M/G/1/GD// queuing system is a difficult matter. Fortunately, however, utilizing the results of Pollaczek and Khinchin, we may determine Lq, L, Ls, Wq, W, Ws.

46

The M/G/1/GD// Queuing System

Pollaczek and Khinchin showed that for the M/G/1/GD// queuing system,
2 2 + 2 Lq = 2(1 ) L = Lq +
Wq = Lq

W = Wq +

It can also be shown that 0, the fraction of the time that the server is idle, is 1-. The result is similar to the one for the M/M/1/GD// system.
47

Finite Source Models

With the exception of the M/G/1/GD// model, all the models we have studied have displayed arrival rates that were independent of the state of the system. There are two situations where the assumption of the state-independent arrival rate may be invalid:
1.

2.

If customers do not want to buck long lines, the arrival rate may be a decreasing function of the number of people present in the queuing system. If arrivals to a system are drawn from a small population, the arrival rate may greatly depend on the state of the system.

48

Finite Source Models

Models in which arrivals are drawn from a small population are called finite source models. In the machine repair problem, the system consists of K machines and R repair people. At any instant in time, a particular machine is in either good or bad condition. The length of time that a machine remains in good condition follows an exponential distribution with rate . Whenever a machine breaks down the machine is sent to a repair center consisting of R repair people.
49

Finite Source Models

The repair center services the broken machines as if they were arriving at an M/G/R/GD// system. Thus, if j R machines are in bad condition, a machine that has just broken will immediately be assigned for repair; if j > R machines are broken, j R machines will be waiting in a single line for a repair worker to become idle. The time it takes to complete repairs on a broken machine is assumed exponential with rate . Once a machine is repaired, it returns to good condition and is again susceptible to breakdown.
50

Finite Source Models

The machine repair model may be modeled as a birthdeath process, where the state j at any time is the number of machines in bad condition. Note that a birth corresponds to a machine breaking down and a death corresponds to a machine having just been repaired. When the state is j, there are K-j machines in good condition. When the state is j, min (j,R) repair people will be busy.
51

Finite Source Models

Rate diagram for 5 machines and 2 repair people:

52

Finite Source Models

Since each occupied repair worker completes repairs at rate , the death rate j is given by
j = j ( j = 0,1,..., R ) j = R ( j = R + 1, R + 2,...K )

If we define p = /, an application of steadystate probability distribution:


K j j = ( j = 0,1,..., R ) j p 0 K j j p j! 0 = jR ( j = R + 1, R + 2,... K ) R! R

53

Finite Source Models

Unfortunately, there are no simple formulas for L, Lq, W, Wq. The best we can do is express these quantities in terms of the js:

L = j j
j =0

j =K

Lq = ( j R) j
j =R

j=K

L W= Lq Wq =
54

Exponential Queues in Series and Open Queuing Networks

In the queuing models that we have studied so far, a customers entire service time is spent with a single server. In many situations the customers service is not complete until the customer has been served by more than one server. A system like the one shown in Figure 19 in the book is called a k-stage series queuing system.
55

Exponential Queues in Series and Open Queuing Networks

56

Exponential Queues in Series and Open Queuing Networks

Theorem 4 If (1)interarrival times for a series queuing system are exponential with rate , (2) service times for each stage I server are exponential, and (3) each stage has an infinite-capacity waiting room, then interarrival times for arrivals to each stage of the queuing system are exponential with rate . For this result to be valid, each stage must have sufficient capacity to service a stream of arrivals that arrives at rate ; otherwise, the queue will blow up at the stage with insufficient capacity.
57

Open Queueing Networks

Open queuing networks are a generalization of queues in series. Assume that station j consists of sj exponential servers, each operating at rate j. Customers are assumed to arrive at station j from outside the queuing system at rate rj. These interarrival times are assumed to be exponentially distributed. Once completing service at station i, a customer joins the queue at station j with probability pij and completes service with probability
58

Open Queueing Networks


Define j, the rate at which customers arrive at station j. 1, 2, k can be found by solving the following systems of linear equations: This follows, because a fraction pij of the i arrivals to station i will next go to station j. Suppose the sjj > j holds for all stations.
59

Open Queueing Networks

Then it can be shown that the probability distribution of the number of customers present at station j and the expected number of customers present at station j can be found by treating station j as an M/M/sj/GD// system with arrival rate j and service rate j. If for some j, sj j j, then no steady-state distribution of customers exists. Remarkably, the number of customers present at each station are independent random variables.
60

Open Queueing Networks

That is, knowledge of the number of people at all stations other than station j tells us nothing about the distribution of the number of people at stations j! This result does not hold, however, if either interarrival or service times are not exponential. To find L, the expected number of customers in the queuing system, simply add up the expected number of customers present at each station. To find W, the average time a customer spends in the system, simply apply the formula L=W to the entire system.
61

The M/G/s/GD/s/ System (Blocked Customers Cleared)

In many queuing systems, an arrival who finds all servers occupied is, for all practical purposes, lost to the system. If arrivals who find all servers occupied leave the system, we call the system a blocked customers cleared, or BCC, system. Assuming that interarrival times are exponential, such a system may be modeled as an M/G/s/GD/s/ system.

62

In most BCC systems, primary interest is focused on the fraction of all arrivals that are turned away. Since arrivals are turned away only when s customers are present, a fraction s of all arrivals will be turned away. Hence, an average of s arrivals per unit time will be lost to the system. Since an average of (1-s) arrivals per unit time will actually enter the system, we may conclude that (1 )

L = Ls =

63

For an M/G/s/GD/s/ system, it can be shown that s depends on the service time distribution only through its mean (1/). The corresponding formula is known as Erlangs loss formula. In other words, any M/G/s/GD/s/ system with an arrival rate and mean service time of 1/ will have the same value of s.
64

Das könnte Ihnen auch gefallen