Simulation 1.1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

Join: vevox.

app ID: 152-860-971

Simulation
IB3200

LECTURE 1
How DES works

Dr Katy Hoad
http://www.wbs.ac.uk/about/person/Kathryn-Hoad/
Join at vevox.app

Or
Search Vevox in the app store

ID: 152-860-971

Join: vevox.app ID: 152-860-971


Join: vevox.app ID: 152-860-971

Covered
in this lecture:

• We will start to see how to construct


simple DES models…
• Carry out a manual simulation.
• Learn about the components of a DES
model.
• How to start describing systems in DES
language using diagrams.
• The Discrete Event (3-phase) method.

3
Example: the bank
Resource

Queue Activity: service

Time

Arrive Start End Leave


service service

Events
4
Manual simulation
Assume Simulation clock starts at 9am. Result of
interest

Customer Service Service Service Waiting


Arrives starts time ends time
(mins) (mins)
9:01 6
9:02 3
9:03 5
9:10 2
9:20 3
5
Join: vevox.app ID: 152-860-971
How DES works…
Arrivals
• How do customers arrive?
– All at once?
– At regular intervals?
– Following some probability distribution?

6
Join: vevox.app ID: 152-860-971
How DES works…
Types of queue discipline
• FIFO (first in, first out)
• LIFO (last in, first out)
• SIRO (serve in random order)
• Priority (e.g. most urgent, shortest
processing time, etc…)

7
Join: vevox.app ID: 152-860-971
How DES works…
Queue types
Can have single or multi-server queues

8
Join: vevox.app ID: 152-860-971
How DES works…
Queue types
Can have single or multi-server queues

9
Join: vevox.app ID: 152-860-971
How DES works…
Service times
Again services times can be:

• Constant (the same set duration)

• Follow some probability distribution

10
Join: vevox.app ID: 152-860-971
How DES works…
Service times
Again services times can be:

• Constant (the same set duration)

• Follow some probability distribution

How we go about collecting data and


modelling arrival and activity times
will be covered in Week 3’s tasks, lecture
and subsequent workshop
11
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model
• Entities = objects in system
– the things which do the queuing

What are the entities in our simple bank simulation?

12
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model
• Activities
– what the entities do

What are the activities in our simple bank simulation?

13
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model
• Attributes (called labels in Simul8)
– characteristics of entities which can determine what
activities they do, in what order, for how long etc...
What could be the attributes in our simple bank
simulation?

14
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model

• Events: discrete points in time.


– arrive, start and end of activities, (leave)

What are the events in our simple bank simulation?

15
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model
• Queues
– real queues (as in a bank)
– virtual queues (hospital waiting list)
– buffers (storage)
What are the queues in our simple bank simulation?

16
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model
• Resources
– required for activities to occur: people, equipment,
materials etc…
– may be
• dedicated (attached to one activity only)
• floating (attached to several activities, although only
one at a time)
• shared (attached to several activities simultaneously)

17
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model
• Resources
– required for activities to occur (people, equipment,
materials etc..): dedicated, floating, shared.

What are the resources in our simple bank simulation?

18
Join: vevox.app ID: 152-860-971
How DES works…
The main components of a DES model

• Duration and clock time

19
Example: Identifying components
In a simulation of a petrol station identify which of the
following are events, which are activities and which are
queues: (assume can not pay at pump)
customer arrives
waits for a petrol pump
starts filling car with petrol
fills car with petrol
finishes filling car with petrol
waits to pay
starts paying
pays and buys sweets
finishes paying
20
Join: vevox.app ID: 152-860-971
DES Process Flow Diagram
- - Building a simple diagram of your system
• Software independent Useful for
conceptual
• Circles = queues Circles and modelling
boxes should – Lecture 2

• Boxes = activities alternate

• An activity can not start until required resource is available –


note this on diagram.
• Temporary entities move through system,
created by a feeder & disposed of by a disposer:
• Can also have Decision points (which could be based on
attributes of entity):

21
e.g. Process flow for the petrol station simulation

Wait for Petrol


Fill car
fuel pump pump

Wait to
Pay
pay

Cashier
22
e.g. Process flow for the petrol station simulation
Capacity?
Service
Queue discipline?
Inter-arrival times
times
Wait for Petrol
Fill car
fuel pump pump
Quantity
available?
Service times

Wait to
Pay
pay

Capacity?
Queue discipline?
Cashier
Quantity
23
available?
How DES software works…
• A DES program keeps a list of future events
and actions them in time order.
• Uses two types of event: conditional and
bound (= can be scheduled)
– Conditional (C-)events: start activities
– Bound (B-)events: end activities and arrivals
• The simulation maintains a future events list
that contains future B-events

24
How DES software works…
The three phases
• Time phase: Move simulation clock
to time of next B-event
• B-phase: Execute all B-events due
at this time
• C-phase: Test conditions of all C-
events and execute any which are
satisfied

25
How DES software works: The Three Phases
• Time phase: Move simulation clock to time of next B-event
• B-phase: Execute all B-events due at this time:

Arrival: End Service:


• Create new entity and put in queue • Dispose of entity
• Schedule next arrival • Make resource free

• C-phase: Test conditions of all C-events and execute any


which are satisfied:
Start Service:
• IF there is an entity in the queue
AND the resource is free THEN
 Take entity off queue
 Make resource busy
 Schedule End Service event 26
Example: the bank
Resource

Queue Activity: service

Time

Arrive Start End Leave


service service

Events
27
How DES software works: The Three Phases
Time now
09.00 Future B-Events list
09.01 Mrs Blonde arrives

ARRIVE QUEUE SERVICE


28
How DES software works: The Three Phases
Time now
09.01 Future B-Events list
09.01 Mrs Blonde arrives

ARRIVE QUEUE SERVICE


29
How DES software works: The Three Phases
Time now
09.01 Future B-Events list
09.01 Mrs Blonde arrives

ARRIVE QUEUE SERVICE


30
How DES software works: The Three Phases
Time now
09.01 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives

ARRIVE QUEUE SERVICE


31
How DES software works: The Three Phases
Time now
09.01 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives

ARRIVE QUEUE SERVICE


32
How DES software works: The Three Phases
Time now
09.01 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free:

ARRIVE QUEUE SERVICE


33
How DES software works: The Three Phases
Time now
09.01 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free:


SATISFIED

ARRIVE QUEUE SERVICE


34
How DES software works: The Three Phases
Time now
09.01 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free:


SATISFIED 09.07 Mrs Blonde ends service
 Take entity off queue,
 Make resource (clerk) busy,
 Schedule End Service B-event.

ARRIVE QUEUE SERVICE


35
How DES software works: The Three Phases
Time now
09.02 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives

09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


36
How DES software works: The Three Phases
Time now
09.02 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives

09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


37
How DES software works: The Three Phases
Time now
09.02 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


38
How DES software works: The Three Phases
Time now
09.02 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


39
How DES software works: The Three Phases
Time now
09.02 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives


09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


40
How DES software works: The Three Phases
Time now
09.02 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives

NOT SATISFIED 09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


41
How DES software works: The Three Phases
Time now
09.03 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


42
How DES software works: The Three Phases
Time now
09.03 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service

ARRIVE QUEUE SERVICE


43
How DES software works: The Three Phases
Time now
09.03 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


44
How DES software works: The Three Phases
Time now
09.03 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


45
How DES software works: The Three Phases
Time now
09.03 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives


09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


46
How DES software works: The Three Phases
Time now
09.03 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives


09.07 Mrs Blonde ends service
NOT SATISFIED
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


47
How DES software works: The Three Phases
Time now
09.07 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


48
How DES software works: The Three Phases
Time now
09.07 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


49
How DES software works: The Three Phases
Time now
09.07 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


50
How DES software works: The Three Phases
Time now
09.07 Future Events list
09.01 Mrs Blonde arrives
09.02 Mr Shades arrives
09.03 Mr Redcoat arrives
09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


51
How DES software works: The Three Phases
Time now
09.07 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives


09.07 Mrs Blonde ends service
09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


52
How DES software works: The Three Phases
Time now
09.07 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives

SATISFIED 09.07 Mrs Blonde ends service


09.10 Ms Smart arrives

ARRIVE QUEUE SERVICE


53
How DES software works: The Three Phases
Time now
09.07 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives

SATISFIED 09.07 Mrs Blonde ends service


 Take entity off queue, 09.10 Ms Smart arrives
 Make resource (clerk) busy, 09.12 Mr Shades ends service
 Schedule End Service B-event.

ARRIVE QUEUE SERVICE


54
How DES software works: The Three Phases
Time now
09.07 Future Events list
Test conditions for C-event: 09.01 Mrs Blonde arrives

If there is an entity in the queue 09.02 Mr Shades arrives

AND the resource (clerk) is free: 09.03 Mr Redcoat arrives

SATISFIED 09.07 Mrs Blonde ends service


 Take entity off queue, 09.10 Ms Smart arrives
 Make resource (clerk) busy, 09.12 Mr Shades ends service
 Schedule End Service B-event.

ARRIVE QUEUE SERVICE


55
What was covered in today’s lecture:

• Introduced some DES terminology and the basic


components of a DES model.
• Introduction to building a (DES) diagram of a
queuing system.
• Understand the underlying structure of a DES
model.

56
POST- LECTURE
ON-LINE
ACTIVITY

Identifying the entities,


resources, events,
activities and queues;
and drawing a process
flow diagram for a simple
launderette system.

57
End of live lecture

Online (Mini.My) Task – video


exercise – follows

58
Exercise: a launderette

A launderette is a shop where there are


washing machines and drying machines
so that people without these facilities at
home can do their own laundry.
These machines are coin operated so that there is no need
to wait for a human server. Assume that all customers
come in with dirty clothes and then wash and dry their
clothes. Each person needs one washer and one dryer.

a. Identify the entities, resources, events, activities and


queues.
b. Draw a process flow diagram for this system.
59

You might also like