Queueing Models: Data Collection and Hand Simulation from Prof. Goldsman’s lecture notes

advertisement
Queueing Models:
Data Collection and Hand Simulation
from Prof. Goldsman’s lecture notes
Outline
Queueing Models
Data Collection
Hand Simulation
Queueing Models
Probabilistic and stochastic models
Important aspects:
Interarrival time
Service time
Waiting time
Mathematics not reality!
Several assumptions:
Arrival process, service process
Queue size and discipline
Time horizon
Calling population
Queueing Models (Cont’d)
M/M/1, M/M/n, M/G/1, etc
Use theoretical model to estimate the behavior of
a real system (this is only an approximation!)
Queues are a model archetype
Queue system entities:
Flow unit
Queue
Server
Where each entity has its own state space and
transitions
Hand Simulation
Time-Flow Mechanism
Time-step incrementation
Stepping through time in equal (e.g. 1 hour) increment
Event-step incrementation
Calls for a simulation to proceed from one event to the
next
Incremental time steps are uneven
Simulation begins at time zero
Occurrence times of the events resulting from the
simulated performance of all system components are
determined
Master clock is updated to the time of the earliest event
occurrence
Commonly used
Concepts
(Pseudo-) Random number generator
Most generator uses U[0, 1]
Steady state
Variability of runs
How to simulate?
State variables: describe state of
system, give a “system snapshot”
Event: anything that can change the
state of the system
FEL (Future Event List)
Clock
Keep all these and any desired
cumulative statistics in a simulation
table
Clock and Socks Example
I have n pairs of socks in my dryer. I
remove socks one at a time and
place them on top of the dryer.
When I get a matching pair, I fold
them and place them in my laundry
basket
How much room do I need on top
of my dryer?
Example (Cont’d)
Assume n pairs distinct socks
Notation: Li, Ri, i = 1, …, n: the two
socks
Assume:
Move a sock from dryer: 1 sec
Check for match and fold: 2 sec
Example (Cont’d)
State variables:
For each i = 1, …, n, Li and Ri
D: if in dryer
T: if on top of the dryer
DT: if being moved to dryer top
B: if in basket
The values of the variables Li and Ri
(together with the clock time t)
provide a complete system snapshot
Example (Cont’d)
Initial Snapshot
Li = Ri = D for all i = 1, …, n
t=0
Extra state variable:
#D = #socks in dryer
#D = 2n initially
#T = # socks on dryer top
#T = 0 initially
Example
(Cont’d)
Event types
Grab:
A sock leaves the dryer
State changes from D to DT
#D decreases
Arrive top:
A sock arrives at the dryer top
State changes from DT to T
Fold:
A pair of socks is matched, folded, and put in basket
Both socks: state changes from T to B
Example (Cont’d)
Activities
• A time interval which triggers an
event
• Moving sock from dryer to top
• Checking for a match
Simulation
Assume we have 2 pairs
t = 0- (start up)
State:
L1 = D
R1 = D
L2 = D
R2 = D
#D = 4
#T = 0
t = 0, grab a sock from dryer
Random integer for socks
Verification and Validation
Verify:
Building the model right
Valid:
Building the right model
Game Time!
Hand Simulation: NISP ATM Simulation
Assumption: 1 ATM Machine
Flip two coins (Arrival and Service Times):
1st Coin:
Head  0 customer enters the NISP ATM
Tail  1 customer enters the NISP ATM
2nd Coin:
Head  service time 10 minutes
Tail  service time 5 minutes
Download