Arrival & Service Times for Assignment 3 Byung-Hyun Ha
What We’ll Do Generate input data for your own Part Number Arrival Time Inter-arrival Time Service Time
Overview Use your student ID as a seed, i.e. Z 0 For i th inter-arrival time (A i ) and service time (S i ) –Generate random integers (Z 2i–1, Z 2i ) –Get random numbers (U 2i–1, U 2i ) from integers –Generate A i and S i from random numbers
Generate Random Integer Linear congruential generator (LCG) –Consult 12.1 of our textbook –Z i = (aZ i-1 + c) mod m –For us a = 13821, c = 0, m = 2 15 = Knuth - and Borosh and Niederreiter LCGs –
Generate Random Integer Example (Zi = Z i-1 mod 32768) –Z 0 = seed: my employee id –Z 1 = mod = –Z 2 = mod = –Z 3 = … You can use a calculator or an excel sheet
Get Random Number U i ~ distributed uniformly in [0,1] –U i = Z i / m = Z i / Example –U 1 = Z 1 / = / 0.98 –U 2 = Z 2 / 0.54 –U 3 = Z 3 / 0.92 –U 4 = Z 4 / 0.59 –…
Generate A i and S i 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 A i and S i Pictorial illustration
Generate A i and S i Assumption –A i ~ distributed exponential with = 5 –S i ~ distributed exponential with = 4 Example –A 1 = -5 ln(1-U 1 ) = -5 ln(1-0.98) –S 1 = -4 ln(1-U 2 ) = -4 ln(1-0.54) 3.12 –A 2 = -5 ln(1-U 3 ) = -5 ln(1-0.92) –S 2 = -4 ln(1-U 4 ) = -4 ln(1-0.59) 3.61
What We Have Done Generate input data for my own Part Number Arrival Time Inter-arrival Time Service Time
Further Readings Chapter 12 of the textbook Linear congruential generator from Wikipedia – al_generatorhttp://en.wikipedia.org/wiki/Linear_congruenti al_generator Knuth - and Borosh and Niederreiter LCGs – de3.htmlhttp://random.mat.sbg.ac.at/~charly/server/no de3.html