SlideShare una empresa de Scribd logo
1 de 27
Simulation Examples
 Three steps of the simulations
 Determine the characteristics of each of the inputs to
the simulation. Quite often, these may be modeled as
probability distributions, either continuous or discrete.
 Construct a simulation table. Each simulation table is
different, for each is developed for the problem at
hand.
 For each repetition i, generate a value for each of the
p inputs, and evaluate the function, calculating a value
of the response yi. The input values may be computed
by sampling values from the distributions determined
in step 1. A response typically depends on the inputs
and one or more previous responses.
Inputs Response
Xi1 Xi2 Xip yiRepetition
s
Xij
 The simulation table provides a systematic
method for tracking system state over time.
… …
1
2
n
·
·
·
2.1 Simulation of Queueing Systems (1)
 A queuing system is described by its calling population, the
nature of the arrivals, the service mechanism, the system
capacity, and the queuing discipline.
Calling population
Waiting Line
Server
Fig. 2.1 Queueing System
2.1 Simulation of Queueing Systems (2)
 In the single-channel queue, the calling population is infinite.
 If a unit leaves the calling population and joins the waiting line or
enters service, there is no change in the arrival rate of other units
that may need service.
 Arrivals for service occur one at a time in a random fashion.
 Once they join the waiting line, they are eventually served.
 Service times are of some random length according to a
probability distribution which does not change over time.
 The system capacity has no limit, meaning that any number of
units can wait in line.
 Finally, units are served in the order of their arrival (often
called FIFO: First In, First out) by a single server or channel.
2.1 Simulation of Queueing Systems (3)
 Arrivals and services are defined by the
distribution of the time between arrivals and the
distribution of service times, respectively.
 For any simple single- or multi-channel queue, the
overall effective arrival rate must be less than the
total service rate, or the waiting line will grow
without bound.
 In some systems, the condition about arrival rate
being less than service rate may not guarantee
stability
2.1 Simulation of Queueing Systems (4)
 System state : the number of units in the system and the
status of the server(busy or idle).
 Event : a set of circumstances that cause an instantaneous
change in the state of the system.
 In a single-channel queueing system there are only two
possible events that can affect the state of the system.
 the arrival event : the entry of a unit into the system
 the departure event : the completion of service on a unit.
 Simulation clock : used to track simulated time.
2.1 Simulation of Queueing Systems (5)
 If a unit has just completed service, the
simulation proceeds in the manner shown in the
flow diagram of Figure 2.2.
 Note that the server has only two possible states : it
is either busy or idle.
Departure
Event
Remove the waiting unit
from the queue
Begin servicing the unit
Begin server
idle time
Another unit
waiting?
YesNo
Fig. 2.2 Service-just-completed flow diagram
2.1 Simulation of Queueing Systems (6)
 The arrival event occurs when a unit enters the
system.
 The unit may find the server either idle or busy.
 Idle : the unit begins service immediately
 Busy : the unit enters the queue for the server.
Arrival
Event
Server
busy?
Unit enters queue
for service
Unit enters
service
YesNo
Fig. 2.3 Unit-entering-system flow diagram
2.1 Simulation of Queueing Systems (7)
Fig. 2.4 Potential unit actions upon arrival
Fig. 2.5 Server outcomes after service completion
2.1 Simulation of Queueing Systems (8)
 Simulations of queueing systems generally require
the maintenance of an event list for determining
what happens next.
 Simulation clock times for arrivals and departures are
computed in a simulation table customized for each
problem.
 In simulation, events usually occur at random times,
the randomness imitating uncertainty in real life.
 Random numbers are distributed uniformly and
independently on the interval (0, 1).
 Random digits are uniformly distributed on the set
{0, 1, 2, … , 9}.
 The proper number of digits is dictated by the
accuracy of the data being used for input purposes.
2.1 Simulation of Queueing Systems (9)
 Pseudo-random numbers : the numbers are generated using a
procedure.
 Table 2.2. Interarrival and Clock Times
 Assume that the times between arrivals were generated by
rolling a die five times and recording the up face.
2.1 Simulation of Queueing Systems (10)
 Table 2.3. Service Times
 Assuming that all four values
are equally likely to occur,
these values could have
been generated by placing
the numbers one through
four on chips and drawing
the chips from a hat with
replacement, being sure to
record the numbers
selected.
 The only possible service
times are one, two, three,
and four time units.
2.1 Simulation of Queueing Systems (11)
 The interarrival times and service times must be meshed to simulate
the single-channel queueing system.
 Table 2.4 was designed specifically for a single-channel queue which
serves customers on a first-in, first-out (FIFO) basis.
2.1 Simulation of Queueing Systems (12)
 Table 2.4 keeps track of the clock
time at which each event occurs.
 The occurrence of the two types of
events(arrival and departure event)
in chronological order is shown in
Table 2.5 and Figure 2.6.
 Figure 2.6 is a visual image of the
event listing of Table 2.5.
 The chronological ordering of events
is the basis of the approach to
discrete-event simulation described
in Chapter 3.
2.1 Simulation of Queueing Systems (13)
 Figure 2.6 depicts the number of customers in the
system at the various clock times.
2.1 Simulation of Queueing Systems (14)
 Example 2.1 Single-Channel Queue
 Assumptions
• Only one checkout counter.
• Customers arrive at this checkout counter at random from 1 to 8
minutes apart. Each possible value of interarrival time has the same
probability of occurrence, as shown in Table 2.6.
• The service times vary from 1 to 6 minutes with the probabilities shown
in Table 2.7.
• The problem is to analyze the system by simulating the arrival and
service of 20 customers.
Checkout Counter
Arrival Departure
2.1 Simulation of Queueing Systems (15)
2.1 Simulation of Queueing Systems (16)
 Example 2.1 (Cont.)
 A simulation of a grocery store that starts with an empty system is
not realistic unless the intention is to model the system from
startup or to model until steady-state operation is reached.
 A set of uniformly distributed random numbers is needed to
generate the arrivals at the checkout counter. Random numbers
have the following properties:
 The set of random numbers is uniformly distributed between 0 and 1.
 Successive random numbers are independent.
 Random digits are converted to random numbers by placing a
decimal point appropriately.
 The rightmost two columns of Tables 2.6 and 2.7 are used to
generate random arrivals and random service times.
2.1 Simulation of Queueing Systems (17)
 Example 2.1 (Cont.) Table 2.8
 The first random digits are 913. To obtain the corresponding time
between arrivals, enter the fourth column of Table 2.6 and read 8 minutes
from the first column of the table.
2.1 Simulation of Queueing Systems (18)
 Example 2.1 (Cont.) Table 2.9
 The first customer's service time is 4 minutes because the
random digits 84 fall in the bracket 61-85
2.1 Simulation of Queueing Systems (19)
 Example 2.1 (Cont.)
 The essence of a manual simulation is the simulation table.
 The simulation table for the single-channel queue, shown in
Table 2.10, is an extension of the type of table already seen in
Table 2.4.
 Statistical measures of performance can be obtained form the
simulation table such as Table 2.10.
 Statistical measures of performance in this example.
 Each customer's time in the system
 The server's idle time
 In order to compute summary statistics, totals are formed as
shown for service times, time customers spend in the system,
idle time of the server, and time the customers wait in the
queue.
2.1 Simulation of Queueing Systems (20)
 The probability that a customer has to wait in the queue : 0.65
65.0
20
13
)( ===
customersofnumberstotal
waitwhocustomersofnumber
waityprobabilit
 The fraction of idle time of the server : 0.21
21.0
86
18
===
simulationoftimeruntotal
serveroftimeidletotal
serveridleofyprobabilit
 The probability of the server being busy: 0.79 (=1-0.21)
Example 2.1 (Cont.)
 The average waiting time for a customer : 2.8 minutes
(min)8.2
20
56
===
customersofnumberstotal
queueinwaitcustomerstimetotal
timewaitngaverage
2.1 Simulation of Queueing Systems (21)
Example 2.1 (Cont.)
 The average service time : 3.4 minutes
(min)4.3
20
68
===
customersofnumberstotal
timeservicetotal
timeserviceaverage
This result can be compared with the expected service time by finding the
mean of the service-time distribution using the following equation.
∑
∞
=
=
0
)()(
s
sspSE
(min)2.3)05.0(6)10.0(5)25.0(4)30.0(3)20.0(2)10.0(1)( =+++++=SE
The expected service time is slightly lower than the average service time in
the simulation. The longer the simulation, the closer the average will be to
)(SE
2.1 Simulation of Queueing Systems (22)
 The average time between arrivals : 4.3 minutes
 The average waiting time of those who wait : 4.3 minutes
(min)3.4
13
56
===
wiatwhocustomersofnumberstotal
queueinwaitcustomerstimetotal
waitwhothoseoftimewaitingaverage
 This result can be compared to the expected time between arrivals by
finding the mean of the discrete uniform distribution whose endpoints are
a=1 and b=8.
(min)3.4
19
82
1
==
−
=
arrivalsofnumbers
arrivalsbetweentimesallofsum
arrivalsbetweentimeaverage
(min)5.4
2
81
2
)( =
+
=
+
=
ba
AE
The longer the simulation, the closer the average will be to )(AE
Example 2.1 (Cont.)
2.1 Simulation of Queueing Systems (23)
 The average time a customer spends in the system : 6.2 minutes
Example 2.1 (Cont.)
(min)2.6
20
124
===
customersofnumberstotal
systeminspendcustomerstimetotal
systemtheinspendscustomertimeaverage
average time
customer spends
in the system
average time
customer spends
waiting in the queue
average time
customer spends
in service
= +
∴ average time customer spends in the system = 2.8 + 3.4 = 6.2 (min)
2.4 Summary
 This chapter introduced simulation concepts via
examples in order to illustrate general areas of
application and to motivate the remaining chapters.
 Ad hoc simulation tables were used in completing the
example. Events in the tables were generated using
uniformly distributed random numbers and, in one case,
random normal numbers.
 The example illustrate the need for determining the
characteristics of the input data, generating random
variables from the input models, and analyzing the
resulting response.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Telephone call-simulation
Telephone call-simulationTelephone call-simulation
Telephone call-simulation
 
Unit 3 des
Unit 3 desUnit 3 des
Unit 3 des
 
Fault avoidance and fault tolerance
Fault avoidance and fault toleranceFault avoidance and fault tolerance
Fault avoidance and fault tolerance
 
Queuing unit v ppt
Queuing unit v pptQueuing unit v ppt
Queuing unit v ppt
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Chapter 02 simulation examples
Chapter 02   simulation examplesChapter 02   simulation examples
Chapter 02 simulation examples
 
System Modeling & Simulation Introduction
System Modeling & Simulation  IntroductionSystem Modeling & Simulation  Introduction
System Modeling & Simulation Introduction
 
Simulation chapter 4
Simulation chapter 4Simulation chapter 4
Simulation chapter 4
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating System
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
 
Simulation of water reservoir
Simulation of water reservoirSimulation of water reservoir
Simulation of water reservoir
 
Flowshop scheduling
Flowshop schedulingFlowshop scheduling
Flowshop scheduling
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
System simulation & modeling notes[sjbit]
System simulation & modeling notes[sjbit]System simulation & modeling notes[sjbit]
System simulation & modeling notes[sjbit]
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 

Similar a Simulation & Modeling - Smilulation Queuing System

Decision policies for production networks
Decision policies for production networksDecision policies for production networks
Decision policies for production networks
Springer
 
queuingtheory-091005084417-phpapp01 (2).pdf
queuingtheory-091005084417-phpapp01 (2).pdfqueuingtheory-091005084417-phpapp01 (2).pdf
queuingtheory-091005084417-phpapp01 (2).pdf
Aditya Mane
 
Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...
Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...
Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...
Andrea Tino
 
Control Systems Lab 2
Control Systems Lab 2Control Systems Lab 2
Control Systems Lab 2
Julia London
 
Foundations and methods of stochastic simulation
Foundations and methods of stochastic simulationFoundations and methods of stochastic simulation
Foundations and methods of stochastic simulation
Springer
 

Similar a Simulation & Modeling - Smilulation Queuing System (20)

DES
DES DES
DES
 
Jerry banks introduction to simulation
Jerry banks   introduction to simulationJerry banks   introduction to simulation
Jerry banks introduction to simulation
 
Simulation analysis of single server queuing model
Simulation  analysis of single server queuing modelSimulation  analysis of single server queuing model
Simulation analysis of single server queuing model
 
Decision policies for production networks
Decision policies for production networksDecision policies for production networks
Decision policies for production networks
 
Sample final report
Sample final reportSample final report
Sample final report
 
2_2_Event_Mechanism_Chapter_2.pdf
2_2_Event_Mechanism_Chapter_2.pdf2_2_Event_Mechanism_Chapter_2.pdf
2_2_Event_Mechanism_Chapter_2.pdf
 
Systems modelling and simulation
Systems modelling and simulationSystems modelling and simulation
Systems modelling and simulation
 
queuingtheory-091005084417-phpapp01 (2).pdf
queuingtheory-091005084417-phpapp01 (2).pdfqueuingtheory-091005084417-phpapp01 (2).pdf
queuingtheory-091005084417-phpapp01 (2).pdf
 
Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...
Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...
Improved implementation of a Deadline Monotonic algorithm for aperiodic traff...
 
Business Logistics Assignment Help
Business Logistics Assignment HelpBusiness Logistics Assignment Help
Business Logistics Assignment Help
 
Final
FinalFinal
Final
 
Queuing theory and its applications
Queuing theory and its applicationsQueuing theory and its applications
Queuing theory and its applications
 
Proposed pricing model for cloud computing
Proposed pricing model for cloud computingProposed pricing model for cloud computing
Proposed pricing model for cloud computing
 
Control Systems Lab 2
Control Systems Lab 2Control Systems Lab 2
Control Systems Lab 2
 
Implementation of the trinity of the control system based on OPC
Implementation of the trinity of the control system based on OPCImplementation of the trinity of the control system based on OPC
Implementation of the trinity of the control system based on OPC
 
Parallel Algorithms: Sort & Merge, Image Processing, Fault Tolerance
Parallel Algorithms: Sort & Merge, Image Processing, Fault ToleranceParallel Algorithms: Sort & Merge, Image Processing, Fault Tolerance
Parallel Algorithms: Sort & Merge, Image Processing, Fault Tolerance
 
Foundations and methods of stochastic simulation
Foundations and methods of stochastic simulationFoundations and methods of stochastic simulation
Foundations and methods of stochastic simulation
 
Discrete Time Batch Arrival Queue with Multiple Vacations
Discrete Time Batch Arrival Queue with Multiple VacationsDiscrete Time Batch Arrival Queue with Multiple Vacations
Discrete Time Batch Arrival Queue with Multiple Vacations
 
Chapter02.pdf.pdf
Chapter02.pdf.pdfChapter02.pdf.pdf
Chapter02.pdf.pdf
 
Queue with Breakdowns and Interrupted Repairs
Queue with Breakdowns and Interrupted RepairsQueue with Breakdowns and Interrupted Repairs
Queue with Breakdowns and Interrupted Repairs
 

Último

Último (20)

On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 

Simulation & Modeling - Smilulation Queuing System

  • 1. Simulation Examples  Three steps of the simulations  Determine the characteristics of each of the inputs to the simulation. Quite often, these may be modeled as probability distributions, either continuous or discrete.  Construct a simulation table. Each simulation table is different, for each is developed for the problem at hand.  For each repetition i, generate a value for each of the p inputs, and evaluate the function, calculating a value of the response yi. The input values may be computed by sampling values from the distributions determined in step 1. A response typically depends on the inputs and one or more previous responses.
  • 2. Inputs Response Xi1 Xi2 Xip yiRepetition s Xij  The simulation table provides a systematic method for tracking system state over time. … … 1 2 n · · ·
  • 3. 2.1 Simulation of Queueing Systems (1)  A queuing system is described by its calling population, the nature of the arrivals, the service mechanism, the system capacity, and the queuing discipline. Calling population Waiting Line Server Fig. 2.1 Queueing System
  • 4. 2.1 Simulation of Queueing Systems (2)  In the single-channel queue, the calling population is infinite.  If a unit leaves the calling population and joins the waiting line or enters service, there is no change in the arrival rate of other units that may need service.  Arrivals for service occur one at a time in a random fashion.  Once they join the waiting line, they are eventually served.  Service times are of some random length according to a probability distribution which does not change over time.  The system capacity has no limit, meaning that any number of units can wait in line.  Finally, units are served in the order of their arrival (often called FIFO: First In, First out) by a single server or channel.
  • 5. 2.1 Simulation of Queueing Systems (3)  Arrivals and services are defined by the distribution of the time between arrivals and the distribution of service times, respectively.  For any simple single- or multi-channel queue, the overall effective arrival rate must be less than the total service rate, or the waiting line will grow without bound.  In some systems, the condition about arrival rate being less than service rate may not guarantee stability
  • 6. 2.1 Simulation of Queueing Systems (4)  System state : the number of units in the system and the status of the server(busy or idle).  Event : a set of circumstances that cause an instantaneous change in the state of the system.  In a single-channel queueing system there are only two possible events that can affect the state of the system.  the arrival event : the entry of a unit into the system  the departure event : the completion of service on a unit.  Simulation clock : used to track simulated time.
  • 7. 2.1 Simulation of Queueing Systems (5)  If a unit has just completed service, the simulation proceeds in the manner shown in the flow diagram of Figure 2.2.  Note that the server has only two possible states : it is either busy or idle. Departure Event Remove the waiting unit from the queue Begin servicing the unit Begin server idle time Another unit waiting? YesNo Fig. 2.2 Service-just-completed flow diagram
  • 8. 2.1 Simulation of Queueing Systems (6)  The arrival event occurs when a unit enters the system.  The unit may find the server either idle or busy.  Idle : the unit begins service immediately  Busy : the unit enters the queue for the server. Arrival Event Server busy? Unit enters queue for service Unit enters service YesNo Fig. 2.3 Unit-entering-system flow diagram
  • 9. 2.1 Simulation of Queueing Systems (7) Fig. 2.4 Potential unit actions upon arrival Fig. 2.5 Server outcomes after service completion
  • 10. 2.1 Simulation of Queueing Systems (8)  Simulations of queueing systems generally require the maintenance of an event list for determining what happens next.  Simulation clock times for arrivals and departures are computed in a simulation table customized for each problem.  In simulation, events usually occur at random times, the randomness imitating uncertainty in real life.  Random numbers are distributed uniformly and independently on the interval (0, 1).  Random digits are uniformly distributed on the set {0, 1, 2, … , 9}.  The proper number of digits is dictated by the accuracy of the data being used for input purposes.
  • 11. 2.1 Simulation of Queueing Systems (9)  Pseudo-random numbers : the numbers are generated using a procedure.  Table 2.2. Interarrival and Clock Times  Assume that the times between arrivals were generated by rolling a die five times and recording the up face.
  • 12. 2.1 Simulation of Queueing Systems (10)  Table 2.3. Service Times  Assuming that all four values are equally likely to occur, these values could have been generated by placing the numbers one through four on chips and drawing the chips from a hat with replacement, being sure to record the numbers selected.  The only possible service times are one, two, three, and four time units.
  • 13. 2.1 Simulation of Queueing Systems (11)  The interarrival times and service times must be meshed to simulate the single-channel queueing system.  Table 2.4 was designed specifically for a single-channel queue which serves customers on a first-in, first-out (FIFO) basis.
  • 14. 2.1 Simulation of Queueing Systems (12)  Table 2.4 keeps track of the clock time at which each event occurs.  The occurrence of the two types of events(arrival and departure event) in chronological order is shown in Table 2.5 and Figure 2.6.  Figure 2.6 is a visual image of the event listing of Table 2.5.  The chronological ordering of events is the basis of the approach to discrete-event simulation described in Chapter 3.
  • 15. 2.1 Simulation of Queueing Systems (13)  Figure 2.6 depicts the number of customers in the system at the various clock times.
  • 16. 2.1 Simulation of Queueing Systems (14)  Example 2.1 Single-Channel Queue  Assumptions • Only one checkout counter. • Customers arrive at this checkout counter at random from 1 to 8 minutes apart. Each possible value of interarrival time has the same probability of occurrence, as shown in Table 2.6. • The service times vary from 1 to 6 minutes with the probabilities shown in Table 2.7. • The problem is to analyze the system by simulating the arrival and service of 20 customers. Checkout Counter Arrival Departure
  • 17. 2.1 Simulation of Queueing Systems (15)
  • 18. 2.1 Simulation of Queueing Systems (16)  Example 2.1 (Cont.)  A simulation of a grocery store that starts with an empty system is not realistic unless the intention is to model the system from startup or to model until steady-state operation is reached.  A set of uniformly distributed random numbers is needed to generate the arrivals at the checkout counter. Random numbers have the following properties:  The set of random numbers is uniformly distributed between 0 and 1.  Successive random numbers are independent.  Random digits are converted to random numbers by placing a decimal point appropriately.  The rightmost two columns of Tables 2.6 and 2.7 are used to generate random arrivals and random service times.
  • 19. 2.1 Simulation of Queueing Systems (17)  Example 2.1 (Cont.) Table 2.8  The first random digits are 913. To obtain the corresponding time between arrivals, enter the fourth column of Table 2.6 and read 8 minutes from the first column of the table.
  • 20. 2.1 Simulation of Queueing Systems (18)  Example 2.1 (Cont.) Table 2.9  The first customer's service time is 4 minutes because the random digits 84 fall in the bracket 61-85
  • 21. 2.1 Simulation of Queueing Systems (19)  Example 2.1 (Cont.)  The essence of a manual simulation is the simulation table.  The simulation table for the single-channel queue, shown in Table 2.10, is an extension of the type of table already seen in Table 2.4.  Statistical measures of performance can be obtained form the simulation table such as Table 2.10.  Statistical measures of performance in this example.  Each customer's time in the system  The server's idle time  In order to compute summary statistics, totals are formed as shown for service times, time customers spend in the system, idle time of the server, and time the customers wait in the queue.
  • 22.
  • 23. 2.1 Simulation of Queueing Systems (20)  The probability that a customer has to wait in the queue : 0.65 65.0 20 13 )( === customersofnumberstotal waitwhocustomersofnumber waityprobabilit  The fraction of idle time of the server : 0.21 21.0 86 18 === simulationoftimeruntotal serveroftimeidletotal serveridleofyprobabilit  The probability of the server being busy: 0.79 (=1-0.21) Example 2.1 (Cont.)  The average waiting time for a customer : 2.8 minutes (min)8.2 20 56 === customersofnumberstotal queueinwaitcustomerstimetotal timewaitngaverage
  • 24. 2.1 Simulation of Queueing Systems (21) Example 2.1 (Cont.)  The average service time : 3.4 minutes (min)4.3 20 68 === customersofnumberstotal timeservicetotal timeserviceaverage This result can be compared with the expected service time by finding the mean of the service-time distribution using the following equation. ∑ ∞ = = 0 )()( s sspSE (min)2.3)05.0(6)10.0(5)25.0(4)30.0(3)20.0(2)10.0(1)( =+++++=SE The expected service time is slightly lower than the average service time in the simulation. The longer the simulation, the closer the average will be to )(SE
  • 25. 2.1 Simulation of Queueing Systems (22)  The average time between arrivals : 4.3 minutes  The average waiting time of those who wait : 4.3 minutes (min)3.4 13 56 === wiatwhocustomersofnumberstotal queueinwaitcustomerstimetotal waitwhothoseoftimewaitingaverage  This result can be compared to the expected time between arrivals by finding the mean of the discrete uniform distribution whose endpoints are a=1 and b=8. (min)3.4 19 82 1 == − = arrivalsofnumbers arrivalsbetweentimesallofsum arrivalsbetweentimeaverage (min)5.4 2 81 2 )( = + = + = ba AE The longer the simulation, the closer the average will be to )(AE Example 2.1 (Cont.)
  • 26. 2.1 Simulation of Queueing Systems (23)  The average time a customer spends in the system : 6.2 minutes Example 2.1 (Cont.) (min)2.6 20 124 === customersofnumberstotal systeminspendcustomerstimetotal systemtheinspendscustomertimeaverage average time customer spends in the system average time customer spends waiting in the queue average time customer spends in service = + ∴ average time customer spends in the system = 2.8 + 3.4 = 6.2 (min)
  • 27. 2.4 Summary  This chapter introduced simulation concepts via examples in order to illustrate general areas of application and to motivate the remaining chapters.  Ad hoc simulation tables were used in completing the example. Events in the tables were generated using uniformly distributed random numbers and, in one case, random normal numbers.  The example illustrate the need for determining the characteristics of the input data, generating random variables from the input models, and analyzing the resulting response.