Presentation is loading. Please wait.

Presentation is loading. Please wait.

Single-Server Queue Model

Similar presentations


Presentation on theme: "Single-Server Queue Model"— Presentation transcript:

1 Single-Server Queue Model
Modeling and Simulation CS 313

2 Specification model The following variables, illustrated in Figure 1.2.2, provide the basis for moving from a conceptual model to a specification model. At their arrival to the service node, jobs are indexed by i = 1, 2, 3, … For each job there are six associated time variables.

3 Specification model (Arrivals)
Rather than specifying the arrival times a1, a2, … explicitly, in some discrete-event simulation applications it is preferable to specify the arrival times r1, r2, …, thereby defining the arrival times implicitly, as shown:

4 Algorithmic question Given a knowledge of the arrival times a1, a2, ... (or, equivalently, the interarrival times r1, r2, ...), the associated service times s1, s2, ..., and the queue discipline, how can the delay times d1, d2, ... be computed? For some queue disciplines this question is more difficult to answer than for others. If the queue discipline is FIFO, however, then the answer is particularly simple. If the queue discipline is FIFO, di is determined by when ai occurs relative to ci−1.

5 Algorithmic question There are two cases to consider:

6 Algorithm The key point in algorithm development is that if the queue discipline is FIFO, then the truth of the expression ai < ci-1 determines whether or not job i will experience a delay. An equation can be written for the delay that depends on the interarrival and service times only. That is: 1

7 Algorithm Algorithm 1.2.1 If the arrival times a1, a2,… and service times s1, s2,… are known, and if the server is initially idle, then this algorithm computes the delays d1, d2,… in a single-server FIFO service node with infinite capacity.

8 Algorithm Algorithm 1.2.1 The GetArrival and GetService procedures read the next arrival and service time from a file. Example: Algorithm used to process n = 10 jobs

9 Example

10 Output statistics The purpose of simulation is insight gained by looking at statistics. The importance of various statistics varies on perspective: Job perspective: wait time is most important Manager perspective: utilization is critical Statistics are broken down into two categories: Job-averaged statistics Time-averaged statistics

11 Job-Averaged Statistics
Job-averaged statistics: computed via typical arithmetic mean Average interarrival time: The reciprocal of the average interarrival time, , is the arrival rate; Average service time: The reciprocal of the average service time, , is the service rate.

12 Output statistics For the 10 jobs in the previous example:
Average interarrival time is: The server is not quite able to process jobs at the rate they arrive on average.

13 Job-Averaged statistics
The average delay and average wait are defined as: Recall wi = di + si for all i The point here is that it is sufficient to compute any two of the statistics The third statistic can then be computed from the other two, if appropriate.

14 Job-Averaged statistics
From the data in the previous example: Therefore: Recall verification is one (difficult) step of model development Consistency check: used to verify that a simulation satisfies known equations:

15 Time-Averaged statistics
Time-averaged statistics: defined by area under a curve (integration) For SSQ, need three additional functions: l (t): number of jobs in the service node at time t q(t): number of jobs in the queue at time t x(t): number of jobs in service at time t. By definition, l (t) = q(t) + x(t) l (t) = 0, 1, 2, . . . q(t) = 0, 1, 2, . . . x(t) = 0, 1

16 Time-averaged statistics
All three functions are piece-wise constant Figures for q(·) and x(·) can be deduced q(t) = 0 and x(t) = 0 if and only if l(t) = 0

17 Time-Averaged statistics
Over the time interval (0, T ): Since l(t) = q(t) + x(t) for all t > 0 Sufficient to calculate any two of

18 Time-Averaged statistics
The average of numerous random observations (samples) of the number in the service node should be close to Same holds for Server utilization: time-averaged number in service also represents the probability the server is busy.


Download ppt "Single-Server Queue Model"

Similar presentations


Ads by Google