Home Download Help Forum Resources Extensions FAQ NetLogo Publications Contact Us Donate Models: Library Community Modeling Commons Beginners Interactive NetLogo Dictionary (BIND) NetLogo Dictionary User Manuals: Web Printable Chinese Czech Farsi / Persian Japanese Spanish

NetLogo User Community Models(back to the NetLogo User Community Models)
WHAT IS IT?
This is a simple queueing system model, with a single, unlimited queue and 110 homogeneous servers. Arrivals follow a Poisson process, and service times are exponentially distributed.
HOW IT WORKS
This is a discreteevent simulation, which is a type of simulation that advances the clock in discrete, often irregularly sized steps, rather than by very small, regular time slices (which are generally used to produce quasicontinuous simulation). At each step, the clock is advanced to the next scheduled event in an event queue, and that event is processed. In this model, the different events are: customer arrival and entry into the queue (followed, if possible, by start of service); service completion, with the customer leaving the system (followed, if possible, by start of service for a new customer); statistics reset; and simulation end. Since these are the only events that can result in a change of the state of the simulation, there is no point in advancing the clock in smaller time steps than the intervals between the events.
HOW TO USE IT
Use the numberofservers slider to set the number of servers; then press the Setup button to create the servers and reset the simulation clock.
The meanarrivalrate and meanservicetime sliders control the arrival and service processes, respectively. These values can be changed before starting the simulation, or at anytime during the simulation run; any changes are reflected immediately in a running model.
The maxruntime and statsresettime control the length of the simulation and the time at which all the aggregate statistics are reset, respectively. The latter allows for minimizing the effects of system startup on the aggregate statistics.
The simulation can be run one step at a time with the Next button, or by repeatedly processing events with the Go button.
The aggregate statistics can be reset at any time  without emptying the queue or placing servers in the idle state  with the Reset Stats button.
THINGS TO NOTICE
After the simulation has started, the next scheduled arrival time is always shown in the Next Arrival Time monitor. When any of the servers are busy, the scheduled time of service completion is shown in the label below the server.
In queueing theory notation, the type of system being simulated in this model is referred to as M/M/n  i.e. Poisson arrivals, exponential service times, infinite queue capacity and source population, FIFO queue discipline. When there is a single server, or when all the servers have the same mean service time, the steady state characteristics (if the system is capable of reaching a steady state) can be determined analytically. In this model, these theoretical values are shown in the bottom row of monitors. If the theoretical server utilization  determined by multiplying the arrival rate by the service time, dividing by the number of servers, and taking the lesser the result of the calculation and 1  is less than 1, then the queueing equations have a defined solution; otherwise, the expected queue length and expected time in the queue are unbounded. In this model, these unbounded values are denoted by "N/A" in the associated monitors.
This model displays servers in a row along the bottom of the NetLogo world; customers are shown in a queue which "snakes" from near the bottom of the NetLogo world to the top. However, these display features are purely for visualization purposes; the positions of the servers and customers, and the colors of the customers, have no functional purpose or impact. The colors of the servers, on the other hand, does have a meaning: an idle server is shown in green, while a busy server is red.
THINGS TO TRY
Run the simulation several times, to get a sense of the effects of the different parameters on the average queue length and average time in the queue. How do these observed statistics compare with the theoretical values? Do the input parameters seem to affect not only the average queue length, but also the variability of the queue length?
EXTENDING THE MODEL
This model could easily be extended to support nonidentical mean service times for different servers (possibly through an Add Server button that creates servers one at a time, each with a specified mean service time value); additional service time distributions besides exponential; a capacitated queue; and alternative queue disciplines (random priority and LIFO would be the easiest to add). However, when simulating a system with these complicating factors, the computations for expected queue length and expected time in the queue can become difficult, or even practically impossible. Note, however, that there is a general relationship  known as Little's formula  between expected queue length and expected time in the queue (or, more generally, between expected number of customers/transactions in the entire system, and the expected time a customer/transaction spends in the system), which holds for even very complicated queueing systems.
NETLOGO FEATURES
This model uses the tickadvance primitive to advance the NetLogo ticks value by nonintegral amounts. This allows the NetLogo clock to be used as a discreteevent simulation clock. However, the standard ticks display (normally seen in the bar above the NetLogo world) is unable to display nonintegral values, so this model uses a separate ticks monitor.
CREDITS AND REFERENCES
Copyright 2010, Nick Bennett, Grass Roots Consulting (http://www.grc.com ). All rights reserved.
Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed: a) this copyright notice is included. b) this model will not be redistributed for profit without permission from Nick Bennett. Contact Nick Bennett (nickbenn@grc.com) for appropriate licenses for redistribution for profit. 
(back to the NetLogo User Community Models)