Discrete time simulation of a queue, Data Structure & Algorithms

Assignment Help:

In this project you will write a program to produce a discrete time simulation of a queue as shown in Fig. 1. Time is slotted on the input and the output. Each input packet follows a Bernoulli process. In a given time slot the independent probability that a packet arrives in a time slot is p, while the probability that the packet will be serviced is q. One packet fills one time slot.        

1775_Queue element.png

The queue can store up to four packets (not the five shown in the diagram above). All packets are processed on a first come - first served basis. Assume that when a packet is serviced all other packets in a queue (if any) are shifted instantaneously towards the output. Each slot departures from the queue are processed before arrivals. 

In your discrete event simulation the program will mimic the operation of the queue and collect statistics. More specifically, you will need to collect (a) throughput and (b) delay statistics for different values of p (p = 0.02, 0.04 up to 1.0 in steps of 0.02), and for a fixed value of q = 0.75. To obtain an accurate statistics you should simulate at least ten thousand time slots for each value of p. Note that you ARE NOT allowed to implement the model equation in the program - but you can use them as a check.

The average throughput is just the number of serviced packets divided by the number of time slots. The average delay of the queue is an average number of time slots a packet is waiting in a queue before it gets serviced (i.e., it is the total number of time slots which all serviced packets spend in the queue divided by the total number of serviced packets). For the delay statistics, it is convenient to store your packets in a linked list and associate the time slot tag with each packet.


Related Discussions:- Discrete time simulation of a queue

Define spanning tree, Define Spanning Tree A Spanning Tree of a connect...

Define Spanning Tree A Spanning Tree of a connected graph is its linked acyclic sub graph (i.e., a tree) that having all the vertices of the graph.

Multiple queue, algorithm for multiple queue with example program

algorithm for multiple queue with example program

Functions for inserting and deleting at either of the end, Q. Develop a rep...

Q. Develop a representation for a list where insertions and deletions can be done at either end. Such a structure is known as a Deque (Double ended queue). Write functions for inse

Train reorganising, A freight train from Melbourne is approaching Sydney, c...

A freight train from Melbourne is approaching Sydney, carrying n cars of cargos. The cargos are to be delivered to n different cities in the metropolitan area of Sydney - one car f

Implement stack using two queues, How To implement stack using two queues ,...

How To implement stack using two queues , analyze the running time of the stack operations ?

Two - way merge sort, Merge sort is also one of the 'divide & conquer' clas...

Merge sort is also one of the 'divide & conquer' classes of algorithms. The fundamental idea in it is to split the list in a number of sublists, sort each of these sublists & merge

Question, A binary search tree is used to locate the number 43. Which of th...

A binary search tree is used to locate the number 43. Which of the following probe sequences are possible and which are not? Explain. (a) 61 52 14 17 40 43 (b) 2 3 50 40 60 43 (c)

Sequential search of a list is preferred over binary search, What are the c...

What are the conditions under which sequential search of a list is preferred over binary search? Sequential Search is a preferred over binary search when the list is unordered

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd