More Explanation of an example in chapter4 T.Sondos
An Example of a Discrete-Event Simulation To simulate a queuing system, we first have to describe it. We assume arrivals are drawn from an infinite calling population. There is unlimited waiting room capacity, and customers will be serve in the order of their arrival (FCFS). Arrivals occur one at a time in a random fashion. All arrivals are eventually served with the distribution of service teams as shown in the book.
Service times are also assumed to be random Service times are also assumed to be random. After service, all customers return to the calling population. For this example, we use the following variables to define the state of the system: (1) the number of customers in the system; (2) the status of the server – that is, whether the server is busy or idle; and (3)the time of the next arrival. An event is defined as a situation that causes the state of the system to change instantaneously.
Next we schedule the departure time of the first customer. All the information about them is maintained in a list called the event list. Time in a simulation is maintained using a variable called the clock time. We begin this simulation with an empty system and arbitrarily assume that our first event, an arrival, takes place at clock time 0. Next we schedule the departure time of the first customer. Departure time = clock time now + generated service time
Also, we now schedule the next arrival into the system by randomly generating an interarrival time from the interarrival time distribution and setting the arrival time as Arrival time = clock time now + generated interarrival time Both these events are their scheduled times are maintained on the event list. This approach of simulation is called the next-event time-advance mechanism, because of the way the clock time is updated. We advance the simulation clock to the time of the most imminent event.
As we move from event to event, we carry out the appropriate actions for each event, including any scheduling of future events. The jump to the next event in the next-event mechanism may be a large one or a small one; that is, the jumps in this method are variable in size. We contrast this approach with the fixed-increment time-advance method. With this method, we advance the simulation clock in increments of Δt time units, where Δt is some appropriate time unit, usually 1 time unit.
For most models, however, the next event mechanism tends to be more efficient computationally. Consequently, we use only the next-event approach for the development of the models for the rest of the chapter. To demonstrate the simulation model, we need to define several variables: TM = clock time of the simulation AT = scheduled time of the next arrival
DT = scheduled time of the next departure SS = status of the server (1=busy, 0=idle) WL = length of the waiting line MX = length (in time units) of a simulation run We now begin the simulation by initializing all the variables. This simple example illustrates some of the basic concepts in simulation and the way in which simulation can be used to analyze a particular problem.