ANALYSING QUEUES USING CUMULATIVE GRAPHS

Size: px
Start display at page:

Download "ANALYSING QUEUES USING CUMULATIVE GRAPHS"

Transcription

1 AALYSIG QUEUES USIG CUMULATIVE GRAPHS G A Vignaux March 9, 1999 Abstract Queueing theory is the theory of congested systems. Usually it only handles steady state stochastic problems. In contrast, here we look at dynamic deterministic systems. To do this we draw and analyse cumulative arrival and departure curves. We examine rush periods and derive Little s Law. One good reference for this approach to queue theory is ewell (1982). This is Revision : 3.6 Contents 1 Queue Systems 2 2 Using cumulative curves to analyse queues Queue Disciplines Attributes of the queue shown by the cumulative graphs Rush periods Analysing a rush period - a simple model Cumulative curves and Inventory 6 5 Averages in the Queue Average Time in the system The average number in the system Little s Law Little s Law: a restatement References ewell, G. F. (1982). Applications of Queueing theory. Chapman and Hall, 2nd edition. cumul Revision : March 9, 1999

2 Queue Systems Restriction Restriction Storage Storage Restriction Storage quel016 Figure 1: Queues are models of networks of congested systems. Something (material, customers, messages) flows through the system. It is held up at restrictions and is stored or delayed in storage elements. In queue theory we call the storage elements queues and the restrictions servers. quel017 Queue Server Figure 2: The simple queue. Much of traditional queueing theory deals with steady-state but random (stochastic) systems. ewell (1982) argues forcibly that that is just playing with toy models and real queues are dynamic: for examples queues form during rush periods. This introduction deals with dynamic models where the rate of into the system can vary in. We limit ourselves to non-random systems. 2 Using cumulative curves to analyse queues The best way to analyse these problems is to plot the cumulative arrival and departure curves against (Figure 3). Cumulative Arrivals in service for number quel005 Figure 3: Graphs of cumulative and against. cumul Revision : March 9, 1999

3 2.1 Queue Disciplines If we label the (Figure 4) we can display how long a particular customer (or job, or message) stayed in the system. Service not FIrst-First-Out (not FIFO) 5 15 not necessarily in same order as quel Figure 4: Cumulative graphs with arrival and departure s for one individual clearly specified. We can label the - so we know which one is which. Then the departure graph may have a zig-zag shape. If they are not labelled, the departure curve will be monotonically increasing. The queue discipline governs the order in which individual customers are processed. There are a number of queue disciplines FIFO or FCFS, first-come, first-served. LIFO, last-in first out. SIRO, Service in random order. Priority Service. If the queue discipline is not FIFO customers may not be in the same order as they arrived. 2.2 Attributes of the queue shown by the cumulative graphs. The number in the system at any instant is the vertical distance between the departure and arrival curves (Figure 5). The in the system is the between arrival and departure; that is the horizontal distance between the curves (Figure 6). The arrival and departure rates are given by the slope of the arrival and departure curves (Figure 7). 3 Rush periods These occur when the departure process (the server) cannot keep up with the rate of (Figure 8). During the rush period the arrival rate is greater than the departure rate. These are often called rush hours. cumul Revision : March 9, 1999

4 5 15 Cumulative Arrivals number in service at t 0 t quel007 Figure 5: Cumulative graphs indicating the number in the system at t. Service not FIrst-First-Out (not FIFO) not necessarily in same order as quel Figure 6: Cumulative graphs showing the individual n spends in the system. Cumulative Arrivals slope is average arrival rate slope is average departure rate over the period 0 t quel008 Figure 7: Cumulative graphs - the slope gives the arrival or departure rates. cumul Revision : March 9, 1999

5 A Rush period 5 15 Rush period quel Figure 8: A rush period occurs when the arrival rate exceeds the departure rate for a. 3.1 Analysing a rush period - a simple model Assume that into a FIFO queue system occur at a rate a over th period 0 to T. o occur outside that interval. The maximum service rate (and therefore the maximum departure rate) is d and d < a. A simplified rush-period, length T t3 a d T t2 quel013 Figure 9: Cumulative graphs for a simplified model of a rush period. Arrival rate is a for period T. This exceeds the potential processing rate, d. We can calculate the total number of,, during the rush period as at. The total the queue exists is t 2 = /d [hr], where = at. Maximum delay to a vehicle, t 3 = t 2 T. t 3 = d T = a d T T = T (a d 1). Total delay, D, imposed by the constriction is the total area between cumul Revision : March 9, 1999

6 the curves. D = t 3 2 = T 2 (a d 1) = T 2 (a d 1)aT = at 2 2 (a d 1). This is measured in vehicle-hours [v.hr] Average delay per vehicle is D/ [hr]. The average number in the queue while it exists is D/t 2 [v]. Let us look at costs. Assume that c = is delay cost per hour per arrival (customer, message, vehicle, etc). The total cost of delay is the the delay cost s the total delay measured in customer-hours, etc. This is cd [$]. Then the average cost of delay per arrival is cd/. Example 3.1 A rush hour lasts 2 hours. Vehicles arrive at rate 50 each hour, but the bridge can only handle vehicles at a rate of 30 per hour. The cost of delay is $ per hour per vehicle. From the description we find the values of parameters. T = 2 [hr], a = 50 [v/hr], d = 30 [v/hr], c = [$/v-hr]. The total number of involved is = at = 50 2 = 0. The maximum delay is therefore, t 2 T = /d T = 0/30 2 = 4/3 [hr]. The total overall delay in vehicle-hours is D = at 2 (a/d 1)/2. (50)2 2 (50/30 1)/2 = 200/3 vehicle-hours. Average delay is D/ = (200/3)/0 = 2/3 [hr/v]. This is The total cost of delay is the total delay in vehicle-hours s the cost per hour of delay: cd = (200/3) = 2000/3 [$]. Hence the average cost of delay per vehicle is $20/3. 4 Cumulative curves and Inventory These methods can also be used to handle general inventory planning problems. For example if the demand is known to vary deterministically over but deliveries have to be in batches (Figure ) or looking over a whole year which has a peak period where demand is greater than production capacity (Figure 11). cumul Revision : March 9, 1999

7 Production and Demand in "lots" inventory demand = quel011 Figure : Cumulative graphs showing fluctuating demand () and deliveries in batches (). Annual Demand demand production peak season Figure 11: Cumulative graphs showing annual demand () with limited production capacity () quel012 cumul Revision : March 9, 1999

8 5 Averages in the Queue Here we derive some average values from the cumulative curves. 5.1 Average Time in the system Between two s when queue = quel Figure 12: Calculating the total area between the arrival and departure graphs between the two points when the queue is of length 0. (By summing the s a customer stays in the system) Look at the cumulative curves between two instants when the number in the system is zero. Average a customer stays in the system = W., W = (Area between the lines). 5.2 The average number in the system Between two s when queue = T quel Figure 13: Calculating the total area by summing the number of customers in the system. Average umber in the system = L (Figure 13). L = (Area between the lines). T cumul Revision : March 9, 1999

9 5.3 Little s Law The area between the lines is the same in each view, that is (Area between the lines) = W = T L. or L = (/T )W. ow, write (/T ) = λ, as the average arrival rate over the period. L = λw Where L = the average number of jobs in the system. λ = the average arrival rate of jobs. W = the average a job spends in the system. This is true only for the period defined and assumes that the number in the system is zero at the start and finish. We extend the model to make the interval as large as we like (that is, it tends to infinity). We then get the result as Little s Law for long run and, particularly, steadystate systems. This law is probably the most important one in queueing theory. Example 5.1 During the morning peak, an average of 250 vehicles back up before the Karori tunnel. I measured the departure rate through the tunnel as 23 vehicles/minute over a period which started and ended with no vehicles backed up. What is the average delay to a vehicle? Use the symbols, [v]= vehicles, [min]= minutes. The arrival and departure rate must be equal over the period (since the queue starts and ends empty) so the arrival rate is λ = 23 [v/min]. We are given that the average number in the system, L = 250 [v] Hence from Little s Law, the average delayed in and before the tunnel is W = L/λ = 250/23 =.9 [min]. 5.4 Little s Law: a restatement IT IS ALWAYS TRUE that in a steady state queueing system L = λw O MATTER WHAT the type of system or where the system boundaries are the number of servers the characteristics (randomness, regularity) of the arrival stream the characteristics of the service s the queue discipline or scheduling system BUT OT IF any units are lost to the system. cumul Revision : March 9, 1999