Q&A and M/D/1 Queues CMSC 12100 / CAPP 30121 - Computer Science - - PowerPoint PPT Presentation

q a and m d 1 queues
SMART_READER_LITE
LIVE PREVIEW

Q&A and M/D/1 Queues CMSC 12100 / CAPP 30121 - Computer Science - - PowerPoint PPT Presentation

Q&A and M/D/1 Queues CMSC 12100 / CAPP 30121 - Computer Science with Applications I Q&A M/D/1 Queues Stack data type A stack is a sequence of items which are added (pushed) to the top of the stack and removed PUSH POP (popped)


slide-1
SLIDE 1

Q&A and M/D/1 Queues

CMSC 12100 / CAPP 30121 - Computer Science with Applications I

slide-2
SLIDE 2

Q&A

slide-3
SLIDE 3

M/D/1 Queues

slide-4
SLIDE 4

Stack data type

BOTTOM TOP BOTTOM TOP PUSH POP

A stack is a sequence of items which are added (pushed) to the top of the stack and removed (popped) from the top.

slide-5
SLIDE 5

Queue data type

A queue is a sequence of items which are added (enqueued) to the back of the queue and removed (dequeued) from the front.

BACK FRONT BACK FRONT DEQUEUE ENQUEUE

slide-6
SLIDE 6

Queue data type

We can use queues to model many real-world processes, such as waiting in line to check in at the airport or waiting to vote at a polling station. These processes often differ in the following aspects:

BACK FRONT

slide-7
SLIDE 7

Queue data type

We can use queues to model many real-world processes, such as waiting in line to check in at the airport or waiting to vote at a polling station. These processes often differ in the following aspects:

  • The number of servers

BACK FRONT

slide-8
SLIDE 8

Queue data type

We can use queues to model many real-world processes, such as waiting in line to check in at the airport or waiting to vote at a polling station. These processes often differ in the following aspects:

  • The number of servers
  • The service time

BACK FRONT

slide-9
SLIDE 9

Queue data type

We can use queues to model many real-world processes, such as waiting in line to check in at the airport or waiting to vote at a polling station. These processes often differ in the following aspects:

  • The number of servers
  • The service time
  • The rate of arrival

BACK FRONT

slide-10
SLIDE 10

M/D/1 queue

In this lecture, we’re going to simulate the movement of customers through an M/D/1 queue.

  • Customer arrivals follow a Markov process (M) with parameter 𝜇. We will

draw customer interarrival times from an exponential distribution with parameter 𝜇.

  • The service time of each customer is deterministic (D) with parameter 𝜈.

Service will take time 1/𝜈 for every customer.

  • There is only one (1) server.
slide-11
SLIDE 11

Example

Let’s say our probability distribution generates the interarrival times 2, 2, and 6. These are the time since last arrival, so we have three customers arriving at times 2, 4, and 10. Let’s also say that service time is exactly 3.

slide-12
SLIDE 12

Example

Time

M/D/1 queue

BACK

3 2 1

slide-13
SLIDE 13

Example

Time 1

M/D/1 queue

BACK

3 2 1

slide-14
SLIDE 14

Example

Time 1 2 Customer 1 arrives, starts service

M/D/1 queue

BACK

1 3 2

slide-15
SLIDE 15

Example

Time 1 2 Customer 1 arrives, starts service 3

M/D/1 queue

BACK

1 3 2

slide-16
SLIDE 16

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives

M/D/1 queue

BACK

1 2 3

slide-17
SLIDE 17

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service

M/D/1 queue 1

BACK

2 3

slide-18
SLIDE 18

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6

M/D/1 queue 1

BACK

2 3

slide-19
SLIDE 19

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 7

M/D/1 queue 1

BACK

2 3

slide-20
SLIDE 20

2

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 7 8 Customer 2 departs

M/D/1 queue

BACK

1 3

slide-21
SLIDE 21

2

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 7 8 Customer 2 departs 9

M/D/1 queue

BACK

1 3

slide-22
SLIDE 22

Example

Time 1 2 Customer 1 arrives, starts service 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 7 8 Customer 2 departs 9 10 Customer 3 arrives, starts service

M/D/1 queue

BACK

3 21