Page 132 - DCAP601_SIMULATION_AND_MODELING
P. 132

Simulation and Modelling



                      Notes         Little’s Equation


                                    Using  = c  in the definition of the time-averaged statistics, along with Little’s Theorem, we
                                              n
                                    have
                                                  n
                                         n c
                                            t
                                     c l    l ( )dt    w   nw
                                                     i
                                     n
                                        0
                                                 i 1
                                    We can perform similar operations and ultimately have
                                                              n          n           n 
                                                         l     w  and q     d   and x    s 
                                                              c n        c n         c n 

                                    Computational Model

                                    1.   The ANSI C program ssq1 implements Algorithm 1.2.1
                                    2.   Data is read from the  file ssq1.dat consisting of arrival times  and service  times in the
                                         format

                                                     a     S
                                                      1     1
                                                     a     S
                                                      2     2
                                                     .     .
                                                     .     .
                                                     .     .
                                                     a     S
                                                      n     n
                                         Since queue discipline is FIFO, no need for a queue data structure


                                          Example
                                    Running program ssq1 with ssq1.dat

                                                               1/r   0.10 and 1/ s   0.14
                                    If you modify program ssq1 to compute l , q, and x
                                                                       x   0.28

                                    Despite the significant idle time, q is nearly 2.
                                    8.1.2 Two-server Queue Simulation


                                    Two Servers in Series

                                    1.   Hypothesis: Nonhomogeneous (t) Poisson arrivals; service at server 1, then by server 2
                                         service for each consumer; service times are RVs with distribution G  and G ; no consumers
                                                                                               1    2
                                         after final arrival time T.
                                    2.   Instances: Airline checkin, doctor’s office, restaurant.
                                    3.   Variables: Time t; counters N , N ; system state SS = (n , n ) = customer #s at server 1,2;
                                                                 A  B                 1  2
                                         output (A (i),A (i),D(i)) customer i  arrival (for each server) and departure times; event list
                                                 1   2
                                         EL = (t , t , t ) next arrival and finishing point times.
                                               A  1  2



            126                              LOVELY PROFESSIONAL UNIVERSITY
   127   128   129   130   131   132   133   134   135   136   137