Escolar Documentos
Profissional Documentos
Cultura Documentos
systems
Stochastic models associated with the queuing - result when the demands on a process exceed the current capacity of that process. A queuing system:
n n
Consists of one or more servers that provide service of some sort to arriving customers. Arriving customers finding all servers busy, generally join one or more queues (lines) in front of the servers,
n
Several examples;,
n n n n n
bank-teller service, computer systems, manufacturing systems, maintenance systems, communications systems etc.
Customers Servers
Arrival Process
n n n
n n
Entities arrive to the system according to some arrival pattern Arrivals are independent of preceding arrivals i.e. successive interarrival times are statistically independent and completely random. Arrivals may originate from one or several sources referred to as the calling population. Population of Customers can be considered either limited (closed systems) or unlimited (open systems). An Unlimited population represents a theoretical model of systems with a large number of possible customers (a bank on a busy street, a motorway petrol station). A limited population may be a number of processes to be run (served) by a computer or a certain number of machines to be repaired by a service man.
Customers may be people, machines of various nature, computer processes, telephone calls, products on an assembly line etc. The arrival process consists of describing how customers arrive to the system. On arrival at the system, they can start service immediately or wait in a queue if the service mechanism is not free. If a customer arrives but fails to enter the system, we say that the customer has balked (leaving without service). The arrival of customers is represented by the time between successive arrivals (called inter-arrival time). If the arrival process is unaffected by the number of customers present, we usually describe the inter-arrival time by specifying a probability distribution.
N. Maingi - November 2012
Mostly the arrivals are random - with random intervals between two adjacent arrivals. Typically the arrival is described by a random distribution of intervals also called Arrival Pattern.
Queue Discipline
n n n
A Queue: represents a certain number of customers waiting for service (of course the queue may be empty). Typically the customer being served is considered not to be in the queue. Sometimes the customers form a queue literally (people waiting in a line for a bank teller).
n n
Sometimes the queue is an abstraction (planes waiting for a runway to land). There are two important properties of a queue:
n n
Maximum Queue Size: (also called System capacity) is the maximum number of customers that may wait in the queue (plus the ones) being served). A Queue is always limited, but some theoretical models assume an unlimited queue length.
n
If the queue length is limited, some customers are forced to renounce without being served.
Queue Discipline: means the rule that a server uses to choose the next customer from the queue (if any) when the server completes the service of the current customer. Queuing Discipline: represents the way the queue is organized (rules of inserting and removing customers to/from the queue).
N. Maingi - November 2007
Customers are served in order of their importance, on the basis of their service requirements.
N. Maingi - November 2012
RR: Round robin, each customer receives, in turn, a small time slice of service. Sharing the capacity of the server: PS (Processor sharing), all customers in the queue are receive service simultaneously Many other more complex queuing methods that typically change the customers position in the queue according to
n n n
the time spent already in the queue, expected service duration, and/or priority
Most queuing models assume FCFS as the queue discipline. Quantitative parameters such as average queue length, average time spent in the system are independent of the queuing discipline. Thats why most models either do not take the queuing discipline into account at all or assume the normal FIFO queue.
n
The only parameter that depends on the queuing discipline is the variance (or standard deviation) of the waiting time.
Service Mechanism
n n
Service: represents some activity that takes time and that the customers are waiting for. It is taken very generally - it may be a real service carried on persons or machines, but it may be a CPU time slice, connection created for a telephone call, being shot down for an enemy plane, etc. A service takes random time.
n
Number of servers:
n n
Theoretical models are based on random distribution of service duration also called Service Pattern.
Systems with one server only are called Single Channel. Systems, systems with more servers are called Multi Channel Systems.
N. Maingi - November 2012
The service mechanism: the way that customers receive service once they are selected from the front of a queue.
n
n n
Service time: the amount of time which a customer takes to be served. A statistical distribution is used to model the service time of a server.
n n
Some queuing models assume a single server, some multiple servers. Generally, most queuing models assume that the system has either a single server or allow the number of servers to become a variable. In many cases, the assumption is that the service time distribution is independent of the number of customers present. i.e. the server does not work faster when more customers are present. Output is mostly ignored by most theoretical models, but sometimes the customers leaving the server enter the queue again ("round robin" time-sharing systems). N. Maingi - November 2012
Queuing Theory
n
A collection of mathematical models for various queuing systems that take as inputs parameters of the above elements and that provide quantitative parameters describing the system performance.
n
Due to their random nature of the processes involved, the queuing theory is rather demanding and all models are based on very strong assumptions (not always satisfied in practice).
Many systems (especially queuing networks) are not solvable at all, so the only technique that may be applied is simulation.
Queuing systems are important provide a trade-off between the various costs of providing service and the costs associated with waiting for the service (or leaving the system without being served).
n
High quality, fast service is expensive, but costs caused by customers waiting in the queue should be minimized. Alternatively, long queues may cost a lot because customers (e.g. machines) do not work while waiting in the queue or customers leave because of long queues lose of business. The ultimate is to find an optimum system configuration (e.g. the optimum number of servers)
n
Although there are numerous examples of queuing systems, it is possible to categorize them into one of four main types;
1) 2) 3) 4)
Single channel single phase system Single channel multiphase system Multi channel Single phase system Multi channel multi phase system
This is a system where an entity arrives, joins a single queue, is served by one server and finally departs
This is a system where an entity joins another queue following service from the first.
Some petrol stations are of this type; the driver will queue for a pump and then queue at the payment booth.
N. Maingi - November 2012
This system is where an entity joins a single queue and is served by the first available server.
This is a system where an entity joins a single queue and is served by the first available server then joins another queue for another service.
Example: the production system of a manufacturing plant e.g. a bottling plant at a brewery
N. Maingi - November 2012
The study of queues determines the measures of performance of a queuing situation, including the average waiting time and the average queue length, among others.
n n
important information to be used to decide on an appropriate level of service for the facility. A decision maker may like to know;
n n n n
What fraction of the time is each server idle? What is the expected number of customers present in the queue? What is the expected time that a customer spends in the queue? What is the probability distribution of the number of customers present in the queue? What is the probability distribution of a customers waiting time?
The following conditions are used to determine the performance measures of a queuing system:
n n n n
Probability distribution of arrival times Probability distribution of service times Number of serving channels Queue/Line discipline
Queuing systems can often be characterized as having random, independent arrivals with mean arrival rate, .
n
Random arrivals suggests that one cannot predict with certainty the arrival of the next customer, job, etc. into the system. Independent arrivals implies that one arrival has nothing to do with the next arrival.
n
The assumption is an assertion that the external world is not generating jobs in a manner that depends on the previous job. Assumption is valid or at least acceptable for a large number of instances.
Whilst we cannot specify for certain when the next arrival will occur, we can collect statistics over the long term and estimate the mean arrival rate of jobs or customers into the system.
N. Maingi - November 2012
We also assume that the jobs or customers that enter the system come from an infinite source population, i.e. the population isn't depleted by the job server(s) that is currently operating within the system.
n
In many cases, the source population is sufficiently large so that this assumption can be made.
Given the independence assumption and the average arrival rate, one can characterize the distribution of arrivals by the Poisson process. Using this distribution, we can say that, for an arrival rate (sometimes also called a rate parameter) over a time interval t, the probability that exactly n jobs or customers will have arrived in the system with a probability Pn(t) defined as:
Note that Pn(0) = 0; i.e. the probability of n jobs arriving in the queue is zero if the time interval is zero.
N. Maingi - November 2012
Suppose that arrivals occur at a processor at the average rate of 6 per second. What is the probability that no arrivals, one arrival or three arrivals will occur in the next second? For zero arrivals, we have:
1
N. Maingi - November 2012
These could be found directly by looking up the values from the Poisson tables. The values for the Poisson probability distribution for the first eleven values for this case are shown
What if we wish to obtain the probabilities of the same number of arrivals as before in the next two seconds? The formulas now become:
Let E[x] be the mean (average) value, Var[x] the variance, and Std[x] the standard deviation of the random variable x which has a Poisson process:
This gives the interpretation of the constant , that is the average number of arrivals per time unit. Thats why the is called Arrival rate.
Exponential Distribution
n
Is the most important, easiest distribution to use in queuing theory. Used to model the time between events that happen at a constant average rate. Inter-arrival times and services times can often be represented exactly or approximately using exponential distribution. The probability distribution function of an exponential distribution is given by
N. Maingi - November 2012
Used to model Poisson processes - situations in which an object initially in state A can change to state B with constant probability per unit time . The time at which the state actually changes is described by an exponential random variable with parameter .
In light of the examples given above, this makes sense: if you receive phone calls at an average rate of 2 per hour, then you can expect to wait half an hour for every call. The variance of X is given by
n n n n
The following symbols are used for arrival and service patterns: M is the Poisson (Markovian) process with exponential distribution of arrival or service duration respectively. Em is the Erlang distribution of intervals or service duration. D is the symbol for deterministic (known) arrivals and constant service duration. G is a general (any) distribution. GI is a general (any) distribution with independent random values.
N. Maingi - November 2012
Examples of queuing systems that can be defined with this convention are: M/M/1:
n n
n n
This is the simplest queuing system to analyze. The arrival and service time are exponentially distributed Poisson processes. The system consists of only one server, Unlimited FIFO or unspecified queue and unlimited customer population. This queuing system applies mostly to a wide variety of problems e.g. a system with a very large number of independent customers. Using a Poisson process for service time however is not applicable in many applications and is only a crude approximation.
N. Maingi - November 2012
M/D/n:
n
n n
The arrival process is Poisson (Markovian) and the service time distribution is Deterministic. The system has n servers. (e.g. a ticket booking counter with n cashiers.) The service time can be assumed to be same for all customers. Unlimited FIFO or unspecified queue and unlimited customer population.
M/G/3/20:
n n n n n
The arrival process is Poisson (Markovian), service pattern is from any distribution (G) There are 3 servers in the system, Queue discipline is FIFO Maximum number of customers in system = 20, Unlimited customer population. Deterministic arrivals, Poisson (Markovian) Service pattern One exponential server, The queue is a stack (LIFO) Maximum size of customers in system = 10, Total customers population = 50.
N. Maingi - November 2012
D/M/1/LIFO/10/50:
n n n n n n
Since both arrival and service are Poisson processes, it is possible to find probabilities of various states of the system, necessary to compute the required quantitative parameters. System state: for this case, the number of customers in the system.
n n n
It may be any non-negative integer number. Let Pn(t) = P[n customers in the system at time t]. Then these processes can be represented by a state transition diagram as shown below:
An arrival transforms the system from its current state, n, to the next state, n+1. The transition rate from a lower to a higher state (arrival rate) is therefore . Similarly, as customers are served (by the server), the system undergoes transitions from higher states (n) to lower states (n-1), a process often referred to as a departure or a death. The rate at which these departures occur is just the service rate, .
N. Maingi - November 2012
probability that n customers are present in the system (np), expected number of customers in the system (L), expected number of customers in the queue (Lq), average waiting time in the system (W), average waiting time in queue (Wq)
Given the transition diagram for the M/M/1 queuing system, we can determine the performance measures.
At a steady state, what enters the system should be the same as what leaves the system. Therefore if we consider state n, what enters the state should be the same as what leaves the state. That is; pn-1 = pn For n =1, we have p0 = p1
p1= p 0
continuing we obtain:
Let the server is processing jobs. Then Pn = np0, 0,1,2,3, to determine the value of P0 and Pn, must satisfy the condition for probability distributions, that is the total probability is unity.
P = (1-)n = 0,1,2,. Is a Geometric distribution. p0 = the Proportion of time the system is idle. Then the utilization, the proportion of time the server is busy is (1-)
is the fraction of time the server is busy (traffic intensity) and is called systems utilization factor.
n n n
Performance of the system: measured by the average waiting time, The average delay on passing through the system, The average number in the queue, etc. Most these results for this system can be calculated directly if we know the value of Pn.
n n
Calculating the average number of entities in the system - a parameter of concern. n represents a distribution of a discrete random variable Number of customers in the system (probabilities of all possible random values). It is possible to compute the mean value, that is the average number of customers in the system: Pn = (1) n , n = 0,1,2,. n E[No. of entities in the system] = Ls
N. Maingi - November 2012
Therefore
This is the mean number in the system - including the entity being attended to. This is sometimes referred to as the mean number in the queue though we usually think of the queue as only those waiting. (Americans refer to this as the line. This is very sensible for queue theorists) N. Maingi - November 2012
The mean number in the system is greater than 0 even if the load (measured by ) is small. The mean number in the system tends to infinity as tends to 1, even though the service rate is still greater than the arrival rate. Note: that must be less than 1, otherwise the number of customers in the system will grow permanently. The variance of the number in the system, N can be obtained from the geometric distribution.
Expected queue length = expected entities in the system minus those in service.
N. Maingi - November 2012
Mean number of entities in system = arrival rate x mean response time (average time a entity spends in the system):n
i.e. the average number of customers in the system is the same as number arriving per unit time times the average time each spends in the system
n n
Therefore: Average time in the system = average number of entities in the system times the inter-arrival time
Average time in the system = expected time in the queue plus expected service time.
Average time an entity spends in queue The mean time in the line (queue) is the time spent waiting before being served.
This is the mean time in the system minus the mean service time, thus
N. Maingi - November 2012
For m n, we have,
Solution: Example 1
1)
2)
3)
We know that = 110 calls/hr. = 1.83calls/min. and S = .5 min./call. Thus a = S = (1.83 calls/min.)(.5 min./call) = .92. For an M/M/1 queuing system, we know that a = , so the attendant is busy 92% of the time. Using the data we calculated above, we can see that the waiting time in the queue is Wq = S/(1-), so Wq = (.92)(.5 min/call)/(1 - .92) = 2.5 min./call. People must wait an average of 2.5 minutes to interact with the operator for 30 seconds, hardly reasonable for most applications.
N. Maingi - November 2012
Finally, the average number of calls in the queue can be found using Little's Formula: Lq = Wq = (1.83 call/min.)(2.5 min./call) = 4.6.
Problem 1
10000 frames/hr can be expected to flow from one network to the other network. What is the average number of packets expected to flow in one second? The expected service time is the time required to transfer a packet across the network. Therefore the average time required to transmit one packets is 0.1 seconds. a) What is the mean service rate? b) This model can be considered as a single-channel, single-phase queuing model or notated as M/M/1 model. Find the utilization of the service facility in this model.
N. Maingi - November 2012
Problem 1 contd
a) What is the probability that there are no frames in the network? b) For a M/M/1 model, find the mean number of units expected to be in the system. c) What is the queue length in this service model? d) The mean time in the system? e) The time of packet in the queue?
Problem 2
Arrivals to a rail ticket office is poisson with mean of 47 an hour. The service time by the single clerk is exponential with a mean of 45 seconds. Assuming that the M/M/1 model applies, a) Calculate the average number of passengers waiting to be served and the average time in the queue. b) Arrival rate = 2 per hr and service time =2 hours
Problem 3
The arrival of lorries at the Strathmore construction area is random with a mean of one every twenty minutes. The time taken to unload a lorry is 15 minutes on average. With a standard deviation of 3.6 minutes. What is the average number of lorries in the queue and the time lorries spend in the system?
Problem 4
A manufacturing firm has two departments, A and B, each running an NC machine; the machines are named MA and MB, respectively. Each machine can produce 25 parts per day. It is observed that an average of 20 parts per day will arrive to MA while an average of 15 parts per day will arrive to MB. a) For MA and MB, determine the expected length of time from submitting a job to be processed until it is completed. Carefully state your modeling assumptions. b) Suppose that the two machines are grouped into a pool; i.e., each machine is available to process parts from both departments. For this arrangement, determine the expected length of time from submitting a job to be processed until it is completed. Carefully state your modeling assumptions. Compare the results with those for part (a).
N. Maingi - November 2012
Problem 5 and 6
Problem 5: Understanding of basic concepts. a) What is the stability condition for the M/M/1 queue? b) What is the stability condition for a system that consists of two distinct M/M/1 queues arranged in tandem? Problem 6 n For a Poisson process X(t), define Sn as the total time until the nth arrival occurs, where n 1. n Compute the distribution of Sn.
N. Maingi - November 2012
Problem 7
A machine produces parts in such a way that the stream of finished parts is a Poisson process with rate = 10 per hour. a) What is the probability that it produces no finished part in 1 hr? th finished b) What is the expected time at which the 20 part is produced? c) What is the probability that 100 parts are produced in a shift of 8 hr, assuming that the machine works non-stop during the shift?
N. Maingi - November 2012
Problem 8
A manufacturing workstation receives a continuous supply of parts and processes them at a rate of 12 parts per hour with exponentially distributed processing time. However, each part needs to be placed on a special fixture before it can be processed. There are N such fixtures available. When completed at the workstation, a fixture part will be sent to the output buffer instantaneously, and the workstation will start to process a new fixture part (if there is one waiting). One at a time, each processed part on its fixture in the output buffer is unloaded from the fixture by a worker (taking zero time), and the time it takes for the worker to load a new part on the fixture is exponentially distributed with mean 4 min. (Hint: The system can be modeled as an M/M/1/N queue) N. Maingi - November 2012
Problem 8 contd
a)
b)
Determine the greatest number of fixtures such that the average waiting time of a part at the workstation is less than 6 min. Does this number of fixtures satisfy the additional requirement that the utilization of the workstation be at least 80%?
Problem 9
A machine center has unlimited waiting space. Parts arrive at a rate l and service times are exponentially distributed with mean 1/m. The machine center becomes active only when K parts are present. Once active it services one at a time until all K units, and all subsequent arrivals, are serviced. The machine center then switches to another part only when K new arrivals have occurred. a) Define the appropriate state space and write down the balance equations b) What is the average time a customer spends in the queue?
N. Maingi - November 2012