110 likes | 256 Views
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 Time 1 0.00 1.73 2.90 2 1.73 1.35 1.76 3 3.08 0.71 3.39 4 3.79 0.62 4.52
E N D
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 TimeService Time 1 0.00 1.73 2.90 2 1.73 1.35 1.76 3 3.08 0.71 3.39 4 3.79 0.62 4.52 5 4.41 14.28 4.46 6 18.69 0.70 4.36 7 19.39 15.52 2.07 8 34.91 3.15 3.36 9 38.06 1.76 2.37 10 39.82 1.00 5.38 11 40.82 . . . . . . . . . .
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
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
Generate Random Integer • Example (Zi = 13821Zi-1mod 32768) • Z0 = 111313 seed: my employee id • Z1 = 13821111313mod 32768 = 32141 • Z2 = 1382132141mod 32768 = 17753 • Z3 = … You can use a calculator or an excel sheet
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 • …
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)
Generate Ai and Si • Pictorial illustration
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
What We Have Done • Generate input data for my own Part Number Arrival Time Inter-arrival Time Service Time 1 0.00 19.78 3.12 2 19.78 12.73 3.61 3 32.51 0.74 6.89 4 33.25 8.92 3.80 5 42.17 8.96 2.65 6 51.13 4.51 0.32 7 55.64 1.07 0.67 8 56.72 2.03 3.77 9 58.74 2.09 2.45 10 60.84 0.95 7.30 11 61.79 . . . . . . . . . .
Further Readings • Chapter 12 of the textbook • Linear congruential generator from Wikipedia • http://en.wikipedia.org/wiki/Linear_congruential_generator • Knuth - and Borosh and Niederreiter LCGs • http://random.mat.sbg.ac.at/~charly/server/node3.html