Академический Документы
Профессиональный Документы
Культура Документы
Simulation
Outline Checkout queue: problem statement Checkout queue model and mode of operation Manual simulation Simulation ideas and simulation algorithm Parameters and metrics Interpretation of simulation results
Simulation
Supermarket Model
Customers come by car which they park at the parking lot- or on foot to the supermarket They shop for a certain average time, some of them visit the butcher, others the info-desk. Then they choose a pay desk, wait their turn in the checkout queue, pay and leave the supermarket.
Simulation
Supermarket Model
Simulation
Checkout queue: Problem statement (1/2) Task: performance evaluation of a checkout counter in a store Objectives: determine
How long do customers have to wait? How many customers are in line? How much of the time is the cashier busy?
Simulation
Simulation
Outline Checkout queue: problem statement Checkout queue model and mode of operation Manual simulation Simulation ideas and simulation algorithm Parameters and metrics Interpretation of simulation results
Simulation
Server
Customers in queue
Served customer
Simulation
How does checkout queue work? Server is idle (no customer present)
immediately, until completion Server is then busy until customer is completely served
Server is busy
of a queue When server becomes idle (a customer has been finished), server checks the queue
Outline Checkout queue: problem statement Checkout queue model and mode of operation Manual simulation Simulation ideas and simulation algorithm Parameters and metrics Interpretation of simulation results
Simulation
10
Arrival of A 2.1
Simulation
11
Clock Departure of A
2.1 3.3 A
At T =3.3, the customer leaves the system The queue is empty, the server becomes idle again
Clock 3.3
Arrival of B 4.5
Simulation
12
At T=4.9, the next customer C arrives at the counter. Server is busy, customer joins the queue Assume this customer will need 1.8 time units for service
Clock
Departure of B 4.9 8.2
1.8 3.7
Simulation
13
Clock
Clock Departure of B
5.6 8.2
B Busy, serving B
Simulation
15
Clock
8.2
B Customer B leaves
Simulation
16
C Busy, serving B
Departure of C
10.
Simulation 17
Will finish: 10
0.7
3.5 1.8
C Busy, serving B
18
Clock Arrival of F
10 12.3 13.5
Simulation
D
Busy, serving D
19
Departure of D
Outline Checkout queue: problem statement Checkout queue model and mode of operation Manual simulation Simulation ideas and simulation algorithm Parameters and metrics Interpretation of simulation results
Simulation
20
Both kinds of events were processed/the state was manipulated according to the algorithm describing the model (see. Slide 9)
Simulation 21
Might be arbitrarily many stored in the future event list Increment the simulation clock to the time of the next, closest event Update the system state as required by the occurrence of this event (usually done by an event routine specific for each kind of event) Compute times for future events
e0 e1 e2 e3 e4 e5
t1
t2
c1
t3
c2
Time
A1
A2
A3
S1 Simulation
S2 23
Simulated Time and Simulation Time Simulated time: The time as measured by the simulation clock, virtual time within the simulated system. Simulation time: Time that is necessary to run a given simulation. Depends on parameters, models, equipment used, accuracy,
Simulation
24
Outline Checkout queue: problem statement Checkout queue model and mode of operation Manual simulation Simulation ideas and simulation algorithm Parameters and metrics Interpretation of simulation results
Simulation
25
Stochastic modeling: consider the time between customers as a random variable, choose a suitable distribution for this variable Common case: interarrival time of customers is exponentially distributed, characterized by the distributions mean Principles of the distribution choice and random variable generation will be discussed later in this course
Simulation
26
Simulation
27
u(n)
T (n)
B (t )dt
T (n )
Simple to measure the absolute time the server has been busy, and at the end divide it by the total time that has been simulated Think of implementation
Simulation
28
Let Di stand for the delay of customer i (possibly 0) Compute the usual arithmetic average of the Di - s
Simulation
29
0 Arrivals
2
e2=t2 e3=t3
4
e8=t5 e7=t4 e6=c3
7
e12=t8
e11=t7 e10=t6
Departures
e4=c1
e5=c2
e9=c4
e13=c5
Simulation
30
Average is taken over a discrete set of individuals Measured value is time Example for discrete-time metric (or statistic) Average is continuously taken over time Measured value is a number, a discrete metric Example for continuous-time metric (or statistic)
Simulation
31
Outline Checkout queue: problem statement Checkout queue model and mode of operation Manual simulation Simulation ideas and simulation algorithm Parameters and metrics Interpretation of simulation results
Simulation
32
Meaning of Measurements
What is the correct interpretation of simulationbased measurements? Waiting time in queue:
Let Di represent the waiting time as measured for customer i This refers to one particular simulation run or to observations on one particular day. For different simulations/on different days, the Di s will be different D are averaged over n customers to obtain aggregate information : average waiting time in queue Other possible aggregations: max, min, percentiles, Both Di s and their aggregate will change from one set of observations to the next
Simulation 33
Meaning of Measurements
Why look at aggregated information of measurements? Aggregated information gives a more concise representation/description of the system under study It is easier to compare aggregated information from different system/simulation runs
The average waiting times in a supermarket on weekdays as opposed to Saturdays is more informative than waiting times of individual customers Variance Percentile
Simulation
34
Meaning of Measurements
Succeeding values might not be distributed in the same way
In the queuing example, D1 is always 0, whereas D2, D3, etc. are not Transient and steady-state periods of simulation
Hence, the average of such values are not the usual statistical average which is usually computed over independent, but identically distributed observations
Simulation
35
Meaning of Measurements
The truly typical (in a statistical sense) behavior of the model can be considered to be the average over all possible behaviors the model can exhibit Weighted by the probabilities of these behaviors
Average ^ Estimates
Di d ( n ) d ( n )
n observations from one run Estimator for true behavior Statistically typical behavior
Variable duration: Simulate as long as it takes for the estimation of the metrics of interest to reach a desired quality level. How long? Stopping rules will be discussed later
Simulation
37