Discrete time simulation of a queue, Data Structure & Algorithms

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.

Posted Date: 2/26/2013 2:40:47 AM | Location : United States







Related Discussions:- Discrete time simulation of a queue, Assignment Help, Ask Question on Discrete time simulation of a queue, Get Answer, Expert's Help, Discrete time simulation of a queue Discussions

Write discussion on Discrete time simulation of a queue
Your posts are moderated
Related Questions
In this unit, we will describe a data structure called Graph. Actually, graph is a general tree along no parent-child relationship. In computer science, Graphs have several applica

write an algorithm and draw a flowchart to calculate the perimeter and area of a circle

Define a B-Tree Justas AVL trees are balanced binary search trees, B-trees are balanced M-way search trees. A B-Tree of order M is either the empty tree or it is an M-way searc

The space-complexity of the algorithm is a constant. It just needs space of three integers m, n and t. Thus, the space complexity is O(1). The time complexity based on the loop

Ask consider the file name cars.text each line in the file contains information about a car ( year,company,manufacture,model name,type) 1-read the file 2-add each car which is repr

A binary tree is a special tree where each non-leaf node can have atmost two child nodes. Most important types of trees which are used to model yes/no, on/off, higher/lower, i.e.,

Define the term 'complexity of an algorithm; Complexity of an algorithm is the calculate of analysis of algorithm. Analyzing an algorithm means predicting the resources that th

The below formula is used to calculate n: n = (x * x)/ (1 - x). Value x = 0 is used to stop the algorithm. Calculation is repeated using values of x until value x = 0 is input. The

This is a k-ary position tree wherein all levels are filled from left to right. There are a number of specialized trees. They are binary trees, AVL-trees, binary search trees, 2

What are expression trees?  The leaves of an expression tree are operands, like as constants or variable names, and the other nodes have operators. This certain tree happens to