q a and m d 1 queues
play

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)


  1. Q&A and M/D/1 Queues CMSC 12100 / CAPP 30121 - Computer Science with Applications I

  2. Q&A

  3. M/D/1 Queues

  4. 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) from the top. TOP TOP BOTTOM BOTTOM

  5. Queue data type A queue is a sequence of items which are added (enqueued) to the FRONT back of the queue and removed DEQUEUE (dequeued) from the front. FRONT BACK ENQUEUE BACK

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

  7. Queue data type We can use queues to model many real-world processes, such as waiting in FRONT 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

  8. Queue data type We can use queues to model many real-world processes, such as waiting in FRONT 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 ● The service time

  9. Queue data type We can use queues to model many real-world processes, such as waiting in FRONT 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 ● The service time ● The rate of arrival

  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.

  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.

  12. Time Example 0 M/D/1 queue BACK 3 2 1

  13. Time Example 0 1 M/D/1 queue BACK 3 2 1

  14. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 1 BACK 3 2

  15. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 1 BACK 3 2

  16. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 1 4 Customer 2 arrives 2 BACK 3

  17. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 2 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service BACK 1 3

  18. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 2 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 BACK 1 3

  19. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 2 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 BACK 7 1 3

  20. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 BACK 7 8 Customer 2 departs 2 1 3

  21. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 BACK 7 8 Customer 2 departs 2 1 3 9

  22. Time Example 0 1 2 Customer 1 arrives, starts service M/D/1 queue 3 3 4 Customer 2 arrives 5 Customer 1 departs, Customer 2 starts service 6 BACK 7 8 Customer 2 departs 21 9 10 Customer 3 arrives, starts service

Recommend


More recommend