Graduate Program in Engineering and Technology Management Simulation of Discrete Event Systems Aslı Sencer
Dynamic Simulation: Queueing System Arrivals Departures Service is identified by: Arrival rate, interarrival time distribution Service rate, service time distribution # servers # queues Queue capacities Queue disciplines, FIFO, LIFO, etc. Aslı Sencer
M/M/1 Queueing System Arrivals Departures Service M: interarrival time is exponentially distributed M: service time is exponentially distributed 1: There is a single server Aslı Sencer
Ex3: Model Specifics Initially (time 0) empty and idle Base time units: minutes Input data (assume given for now …), in minutes: Part Number Arrival Time Interarrival 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 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 . . . . . . Stop when 20 minutes of (simulated) time have passed Aslı Sencer
Queuing Simulation Random variables: Events: State variables: Time between arrivals Service time represented by probability distributions. Events: Arrival of a customer to the system Departure from the system. State variables: # customers in the queue Worker status {busy, idle} Output measures: Average waiting time in the queue % utilization of the server Average time spent in the system Aslı Sencer
Output Performance Measures Total production of parts over the run (P) Average waiting time of parts in queue: Maximum waiting time of parts in queue: N = no. of parts completing queue wait WQi = waiting time in queue of ith part Know: WQ1 = 0 (why?) N > 1 (why?) Aslı Sencer
Output Performance Measures (cont’d.) Time-average number of parts in queue: Maximum number of parts in queue: Average and maximum total time in system of parts: Q(t) = number of parts in queue at time t TSi = time in system of part i Aslı Sencer
Output Performance Measures (cont’d.) Utilization of the machine (proportion of time busy) Many others possible (information overload?) Aslı Sencer
Simulation by Hand Manually track state variables, statistical accumulators Use “given” interarrival, service times Keep track of event calendar “Lurch” clock from one event to the next Will omit times in system, “max” computations here (see text for complete details) Aslı Sencer
Simulation by Hand: Setup Aslı Sencer
Simulation by Hand: t = 0.00, Initialize Aslı Sencer
Simulation by Hand: t = 0.00, Arrival of Part 1 Aslı Sencer
Simulation by Hand: t = 1.73, Arrival of Part 2 Aslı Sencer
Simulation by Hand: t = 2.90, Departure of Part 1 Aslı Sencer
Simulation by Hand: t = 3.08, Arrival of Part 3 2 Aslı Sencer
Simulation by Hand: t = 3.79, Arrival of Part 4 2 Aslı Sencer
Simulation by Hand: t = 4.41, Arrival of Part 5 3 2 Aslı Sencer
Simulation by Hand: t = 4.66, Departure of Part 2 5 4 3 Aslı Sencer
Simulation by Hand: t = 8.05, Departure of Part 3 4 Aslı Sencer
Simulation by Hand: t = 12.57, Departure of Part 4 Aslı Sencer
Simulation by Hand: t = 17.03, Departure of Part 5 Aslı Sencer
Simulation by Hand: t = 18.69, Arrival of Part 6 Aslı Sencer
Simulation by Hand: t = 19.39, Arrival of Part 7 6 Aslı Sencer
Simulation by Hand: t = 20.00, The End 7 6 Aslı Sencer
Ex3:Complete Record of the Hand Simulation Aslı Sencer
Ex3: Simulation by Hand: Finishing Up Average waiting time in queue: Time-average number in queue: Utilization of drill press: Aslı Sencer
Entity Based-Simulation ITEM # INTERARRIVAL TIME ARRIVAL TIME SERVICE TIME START SERVICE TIME END SERVICE TIME WAIT TIME TIME IN SYSTEM 1 1,73 0,00 2,90 2 1,35 1,76 4,66 1,17 2,93 3 0,71 3,08 3,39 8,05 1,58 4,97 4 0,62 3,79 4,52 12,57 4,26 8,78 5 14,28 4,41 4,46 17,03 8,16 12,62 6 0,70 18,69 4,36 23,05 7 15,52 19,39 2,07 8 3,15 34,91 Since simulation ends at 20th minute, 6th item’s process will not be completed! The last event that occurs in a simulation will be the arrival of 7th item! Average wait time=(0+1.17+1.58+4.26+8.16+0)/6=2.53min Average time in system=(2.9+2.93+4.97+8.78+12.62+4.36)/6=36.56/6=6.09min Aslı Sencer
Randomness in Simulation The above was just one “replication” — a sample of size one (not worth much) Made a total of five replications: Confidence intervals for expected values: In general, For expected total production, Note substantial variability across replications Aslı Sencer
Comparing Alternatives Usually, simulation is used for more than just a single model “configuration” Often want to compare alternatives, select or search for the best (via some criterion) Simple processing system: What would happen if the arrival rate were to double? Cut interarrival times in half Rerun the model for double-time arrivals Make five replications Aslı Sencer
Results: Original vs. Double-Time Arrivals Original – circles Double-time – triangles Replication 1 – filled in Replications 2-5 – hollow Note variability Danger of making decisions based on one (first) replication Hard to see if there are really differences Need: Statistical analysis of simulation output data Aslı Sencer