Arrival & Service Times for Assignment 3 Byung-Hyun Ha [email protected].

11
Arrival & Service Times for Assignment 3 Byung-Hyun Ha [email protected]

Transcript of Arrival & Service Times for Assignment 3 Byung-Hyun Ha [email protected].

Page 1: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Arrival & Service Times for Assignment 3

Byung-Hyun Ha

[email protected]

Page 2: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

What We’ll Do

• Generate input data for your own

Part Number Arrival Time Inter-arrival Time Service Time1 0.00 1.73 2.902 1.73 1.35 1.763 3.08 0.71 3.394 3.79 0.62 4.525 4.41 14.28 4.466 18.69 0.70 4.367 19.39 15.52 2.078 34.91 3.15 3.369 38.06 1.76 2.3710 39.82 1.00 5.3811 40.82 . .. . . .. . . .

Page 3: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Overview

• Use your student ID as a seed, i.e. Z0

• For ith inter-arrival time (Ai) and service time (Si)

– Generate random integers (Z2i–1, Z2i)

– Get random numbers (U2i–1, U2i) from integers

– Generate Ai and Si from random numbers

Page 4: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Generate Random Integer

• Linear congruential generator (LCG)– Consult 12.1 of our textbook

– Zi = (aZi-1 + c) mod m

– For us a = 13821, c = 0, m = 215 = 32768• Knuth - and Borosh and Niederreiter LCGs

– http://random.mat.sbg.ac.at/~charly/server/node3.html

Page 5: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Generate Random Integer

• Example (Zi = 13821Zi-1 mod 32768)

– Z0 = 111313 seed: my employee id

– Z1 = 13821111313 mod 32768 = 32141

– Z2 = 1382132141 mod 32768 = 17753

– Z3 = …

You can use a calculator or an excel sheet

Page 6: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Get Random Number

• Ui ~ distributed uniformly in [0,1]

– Ui = Zi / m = Zi / 32768

• Example– U1 = Z1 / 32768 = 32141 / 32768 0.98

– U2 = Z2 / 32768 0.54

– U3 = Z3 / 32768 0.92

– U4 = Z4 / 32768 0.59

– …

Page 7: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Generate Ai and Si

• Generating random variates– Consult 12.2 of our textbook

• In case of exponential dist. with = – PDF: f(x) = (1/)e-x/

– CDF: F(x) = 1 - e-x/

– with U ~ distributed uniformly in [0,1]• U = F(X) = 1 - e-X/

X = -ln(1 – U)

Page 8: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Generate Ai and Si

• Pictorial illustration

Page 9: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Generate Ai and Si

• Assumption– Ai ~ distributed exponential with = 5

– Si ~ distributed exponential with = 4

• Example– A1 = -5ln(1-U1) = -5ln(1-0.98) 19.78

– S1 = -4ln(1-U2) = -4ln(1-0.54) 3.12

– A2 = -5ln(1-U3) = -5ln(1-0.92) 12.73

– S2 = -4ln(1-U4) = -4ln(1-0.59) 3.61

Page 10: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

What We Have Done

• Generate input data for my own

Part Number Arrival Time Inter-arrival Time Service Time1 0.00 19.78 3.122 19.78 12.73 3.613 32.51 0.74 6.894 33.25 8.92 3.805 42.17 8.96 2.656 51.13 4.51 0.327 55.64 1.07 0.678 56.72 2.03 3.779 58.74 2.09 2.4510 60.84 0.95 7.3011 61.79 . .. . . .. . . .

Page 11: Arrival & Service Times for Assignment 3 Byung-Hyun Ha bhha@pusan.ac.kr.

Further Readings

• Chapter 12 of the textbook• Linear congruential generator from Wik

ipedia– http://en.wikipedia.org/wiki/Linear_congruenti

al_generator

• Knuth - and Borosh and Niederreiter LCGs– http://random.mat.sbg.ac.at/~charly/server/no

de3.html