1 / 14

NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly

NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly. Lecture (4) The Event Scheduling/ Time Advance Algorithm. The Future Event List (FEL). FEL: contains all the notices for events scheduled to occur at a future time

mimir
Télécharger la présentation

NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly

  2. Lecture(4) The Event Scheduling/ Time Advance Algorithm

  3. The Future Event List (FEL) • FEL: contains all the notices for events scheduled to occur at a future time • At any given time (t), the FEL contains all previously scheduled future events and their associated event times, e.g.: t1, t2, t3, …, etc. See Fig. • The FEL is ordered by event time, i.e. events are arranged chronologically so that the event time satisfies t ≤ t1 ≤ t2 ≤ … ≤ tn • At time (t), i.e. CLOCK = t, the event associated with t1 is called the imminent event. That is, the event that will occur

  4. Advancing Simulation Time and Updating System Image • Old snapshot at time t Event scheduling/time advance algorithm Step 1. Remove the event notice for the imminent event (event 3, time t1) from the FEL Step 2. Advance CLOCK to imminent event time (i.e. advance CLOCK from t to t1) Step 3. Execute imminent event; update system state; change entity attributes; and set membership as needed Step 4. Generate future events (if necessary) and place their event notices on the FEL, ranked by event time, e.g. event 4 to occur at time t*, where t1 < t*< t1 Step 5. Update cumulative statistics and counters

  5. Advancing Simulation Time and Updating System Image • New snapshot at time t1

  6. Generation of External Arrival Stream by Bootsrapping At simulated time t, assumed to be the instant of the nth arrival, generate interarrival time a*, compute t*=t + a* and schedule future arrival on FEL to occur at future time t* …. …. Arrival 1 2 3 n n+1 Arrival Time 3.7 t* Time CLOCK = 7.4 0 4.1 t a* Between successive arrival events, other types of events may occur, causing system state to change

  7. Stopping a Simulation • At time 0, schedule a stop simulation event at a specified future time TE. The simulation will run over the time interval [0, TE] • Example: Simulate a shop for 8 hours • Run length TE is determined by the simulation itself. TE is the time of occurrence of some event E. - Example: TE = time of the 100th service completion

  8. Example: Checkout Counter • Grocery store with one checkout counter. The stopping time is set to 60 minutes • Model Components: • Time the customer spends in waiting • LQ(t): number of customers waiting in line at time t • LS(t): number being served (0 or 1) at t • Inter-arrival time • Service time • Servers and customers • (A, t): Arrival event to occur at future time t • (D, t): Departure event to occur at future time t • (E, 60): Stopping event to occur at future time 60 • Arrivals (A) • Departures (D) • Stopping (E)

  9. Execution of the Arrival Event Arrival event occurs at CLOCK = t Step 3 Step 3 No Yes LS(t) = 1? Increment LQ(t) by 1 Set LS(t) = 1 Step 4 Generate service time s*; Schedule new departure event at t + s* Step 4 Generate interarrival time a*; schedule next arrival event at t + a* Step 5 Collect statistics Return control to time-advance routine to continue simulation

  10. Execution of the Departure Event Departure event occurs at CLOCK = t Step 3 Step 3 No Yes LQ(t) > 0? Decrement LQ(t) by 1 Set LS(t) = 0 Step 4 Generate service time s*; Schedule new departure event at t + s* Step 5 Collect statistics Return control to time-advance routine to continue simulation

  11. Evolution of the Event List B = Total server busy time MQ = maximum queue length

  12. Experiment Modification • Redesign the simulation to calculate the mean response time and mean proportion of customers who spend 5 or more minutes in the system • Hints: • Response time is the length of time the customer spends in the system • To calculate the response time for an individual customer, it is necessary to know the arrival and departure times of that customer • Therefore, a customer entity with arrival time as an attribute will be added to the list of model components • Event notices on the FEL will be expanded to indicate which is affected

  13. Additional Model Components • Time the customer spends in waiting • S: set of customer response times for all customers who have departed by the current time • F: total number of customers who have spent more than 5 minutes in the system • ND: total number of departures up to the current time • LQ(t): number of customers waiting in line at time t • LS(t): number being served (0 or 1) at t • Inter-arrival time • Service time • Servers and customers • (Ci, t): customer i who arrived at time t • Arrivals (A) • Departures (D) • Stopping (E) • (A, t): Arrival event to occur at future time t • (D, t): Departure event to occur at future time t • (A, t, Ci): Arrival of customer (Ci) to occur at future time t • (D, t, Cj): Departure of customer (Cj) to occur at future time t • (E, 60): Stopping event to occur at future time 60

  14. New Simulation Table

More Related