Top Banner
1 Chapter 2 & 3 Simulation Examples and General Principles
48
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Chapter 2 & 3 Simulation Examples and General Principles.

1

Chapter 2 & 3

Simulation ExamplesandGeneral Principles

Page 2: 1 Chapter 2 & 3 Simulation Examples and General Principles.

2

Basic Steps

Determine the characteristics of the inputs. Usually modeled as probability distributions

Construct a simulation table. Problem specific Often consists of a set of inputs and one of more responses Repetitions

Repeatedly generate a value for each input andevaluate the function.

Page 3: 1 Chapter 2 & 3 Simulation Examples and General Principles.

3

Simulation table

Repetition

xi1 xi2 … Xip Yi

1

2

N

Page 4: 1 Chapter 2 & 3 Simulation Examples and General Principles.

4

Simulation Examples and General Principles Simulation examples (chap. 2)

Concrete & specific cases in various areasExample:

1 + 2 + 3 + …. + 100 = ?

General principles (chap. 3)Generalized representations and conceptsExample:

i, n, S

Page 5: 1 Chapter 2 & 3 Simulation Examples and General Principles.

5

Simulation of Queuing Systems

A queuing system consists of:1. Calling population.

Often infinite: a unit leaves, there is no change in the arrival rate.

2. Arrivals. Random.

3. Service mechanism. A unit will be served in random length based on a probability

distribution.

4. System capacity. No limit (waiting line length)

5. Queuing discipline. Order of service, e.g., FIFO.

Page 6: 1 Chapter 2 & 3 Simulation Examples and General Principles.

6

Simulation of Queuing Systems

Page 7: 1 Chapter 2 & 3 Simulation Examples and General Principles.

7

Queuing Systems

Arrivals and services are defined by the probability distribution of time between arrivals and the distribution of service times, respectively.

Service rate vs. arrival rate Unstable or explosive

State Number of units in a system and status of server

Event Stimulus that causes system state to change.

Simulation clock Trace of simulation time.

Page 8: 1 Chapter 2 & 3 Simulation Examples and General Principles.

8

Single-Channeling Queuing System What are the entities? What are the states? What are the events? When do events

occur or how to model events? How do the states change when the

events occur?

Page 9: 1 Chapter 2 & 3 Simulation Examples and General Principles.

9

Single-Channeling Queuing System

Service-just-completed flow diagram

Page 10: 1 Chapter 2 & 3 Simulation Examples and General Principles.

10

Single-Channeling Queuing System

Unit-entering-system flow diagram

Page 11: 1 Chapter 2 & 3 Simulation Examples and General Principles.

11

Single-Channeling Queuing System

Potential unit actions upon arrival

Page 12: 1 Chapter 2 & 3 Simulation Examples and General Principles.

12

Single-Channeling Queuing System

Server outcomes after service completion

Page 13: 1 Chapter 2 & 3 Simulation Examples and General Principles.

13

Single-Channeling Queuing System

Simulation example:

Consider the following two tables represents the arrivals (interarrival) and service times in a grocery store.

Page 14: 1 Chapter 2 & 3 Simulation Examples and General Principles.

14

Single-Channeling Queuing System

Interarrival and clock times service times

Page 15: 1 Chapter 2 & 3 Simulation Examples and General Principles.

15

Single-Channeling Queuing System

Simulation table

Service time of the first customer is 2 and it can start at 0, thus it will finish at 2

Page 16: 1 Chapter 2 & 3 Simulation Examples and General Principles.

16

Single-Channeling Queuing System

Simulation table

Service time of the second customer is 1 and it can start at 2, thus it will finish at 3

Page 17: 1 Chapter 2 & 3 Simulation Examples and General Principles.

17

Single-Channeling Queuing System

Simulation table

Page 18: 1 Chapter 2 & 3 Simulation Examples and General Principles.

18

Single-Channeling Queuing System

Simulation table

Page 19: 1 Chapter 2 & 3 Simulation Examples and General Principles.

19

Single-Channeling Queuing System

Simulation table

Page 20: 1 Chapter 2 & 3 Simulation Examples and General Principles.

20

Single-Channeling Queuing System

Page 21: 1 Chapter 2 & 3 Simulation Examples and General Principles.

21

Single-Channeling Queuing System

Page 22: 1 Chapter 2 & 3 Simulation Examples and General Principles.

22

Another example (single server)

Page 23: 1 Chapter 2 & 3 Simulation Examples and General Principles.

23

Another example (single server)

Page 24: 1 Chapter 2 & 3 Simulation Examples and General Principles.

24

Another example (single server)

Page 25: 1 Chapter 2 & 3 Simulation Examples and General Principles.

25

Another example (single server)

Page 26: 1 Chapter 2 & 3 Simulation Examples and General Principles.

26

Another example (single server)

Page 27: 1 Chapter 2 & 3 Simulation Examples and General Principles.

27

Another example (single server)

Page 28: 1 Chapter 2 & 3 Simulation Examples and General Principles.

28

Page 29: 1 Chapter 2 & 3 Simulation Examples and General Principles.

29

Page 30: 1 Chapter 2 & 3 Simulation Examples and General Principles.

30

Page 31: 1 Chapter 2 & 3 Simulation Examples and General Principles.

31

Page 32: 1 Chapter 2 & 3 Simulation Examples and General Principles.

32

Page 33: 1 Chapter 2 & 3 Simulation Examples and General Principles.

33

Page 34: 1 Chapter 2 & 3 Simulation Examples and General Principles.

34

Page 35: 1 Chapter 2 & 3 Simulation Examples and General Principles.

35

Page 36: 1 Chapter 2 & 3 Simulation Examples and General Principles.

36

Page 37: 1 Chapter 2 & 3 Simulation Examples and General Principles.

37

Summary of Simulation Table Based Approach Basic simulation concepts:

Determine the characteristics of the input data. Construct a simulation table. Generate random variables from the input models &

calculate values of the response. Analyze the results.

Main problem with simulation table approach: Can’t deal with complex dependencies.

Page 38: 1 Chapter 2 & 3 Simulation Examples and General Principles.

38

Other Examples

The Able Baker Carhop Problem: Two channels. Inventory Systems

Simulation of an (M, N) inventory system. Reliability Problem

Evaluation of alternatives Military Problem

Random Normal Numbers Lead-Time Demand

Histogram

Page 39: 1 Chapter 2 & 3 Simulation Examples and General Principles.

39

Able-Baker example (two servers) Two servers queuing example

Page 40: 1 Chapter 2 & 3 Simulation Examples and General Principles.

40

Able-Baker example (two servers)

Page 41: 1 Chapter 2 & 3 Simulation Examples and General Principles.

41

Able-Baker example (two servers) We will start using excel to construct the simulation

table for this example. (see www.bcnn.com) Usually the row for first customer is filled manually.

You need a random function to provide random digits (two digits in this case)

Fill in the other values based on the provided tables and these random digits (manually)

Write formulas to fill in the rows (usually) starting from row 2

Page 42: 1 Chapter 2 & 3 Simulation Examples and General Principles.

42

Able-Baker example (two servers)

Simple formulas:

next arrival clock time = previous arrival clock time + interarrival time C2=C1+B2

B2 value is based on the interarrival table and random digits generated

A B C D E F G H I J k L

Page 43: 1 Chapter 2 & 3 Simulation Examples and General Principles.

43

Able-Baker example (two servers)

Simple formulas:

When able available = max number currently in column I

D2=max(I$1:I1)

D10=max(I$1:I9)

A B C D E F G H I J k L

Page 44: 1 Chapter 2 & 3 Simulation Examples and General Principles.

44

Able-Baker example (two servers)

More complex formulas:

Next person will be served (directly or after a wait) by Able if he arrive and finds able free or able becomes free before Baker

F2=IF(OR(D2<=C2,D2<=E2),"Able","Baker")

A B C D E F G H I J k L

Page 45: 1 Chapter 2 & 3 Simulation Examples and General Principles.

45

Able-Baker example (two servers)

Time service begin: to fill it for Able if he is the intended person

If the server person is Able, then the service will begin at the max of either the arrival or when Able is available.

Else, the service will begin by Baker at the max of the customer arrival time and Baker being available

H2=IF(F2="Able",MAX(D2,C2),MAX(E2,C2))

A B C D E F G H I J k L

Page 46: 1 Chapter 2 & 3 Simulation Examples and General Principles.

46

Able-Baker example (two servers)

The time service is completed by Able

If Able is the person serving, then it will be after service time begin plus service time.

Else, it will be BlankI2=IF($F2="Able",$H2+$G2,"")

A B C D E F G H I J k L

Page 47: 1 Chapter 2 & 3 Simulation Examples and General Principles.

47

Able-Baker example (two servers)

Page 48: 1 Chapter 2 & 3 Simulation Examples and General Principles.

48

Able-Baker example (two servers)

Frequency of Caller Delay

62

126 4 5 7 3 1 0 0

0

20

40

60

80

0 2 4 6 8 10 12 14 16 18

Upper limit of bin

Occu

rren

ces

In addition to the performance measures we usually compute, the a frequency diagram like the following is an important measure.