Simulation of queues, Data Structure & Algorithms

Simulation is the process of making an abstract model of a real world situation in order to be aware of the effect of modifications and alterations and the effect of introducing number of strategies on the situation. The simulation program must necessity schedule the events in the simulation so the activities occur in the correct time sequence.  Take an example, suppose a person visit an outlet at time 't1' to deposit the bill of his cell phone. The transaction can be expected to take a certain period of the time 't2' to complete. If any of the service window is free or not busy, then the person can immediately deposit the bill in time (t1+t2) spending the exact time required to deposit the bill. If none of the service window is free and there is long queue waiting at each window. Then the person joins the smallest queue and waits until all previous people deposits their bills and leaves the line. In such case, the time spends by person in the bill office in t2+time spends in waiting. These kinds of problem are solved by writing a program to simulate the actions of the persons. The various service windows can be represented by different queues and each person waiting in that line is represented by the node in that particular queue. The node at the front of the queue represents the person currently taking service at the window. We can define  various  events related  with  the  process  like  arrival  of  a  person and departure of a person etc.

When a departure node is removed from the event list when the person leaves, the amount of time spent by  the  departing  person  is  computed  and  added  to  a  total  and  the  node representing the person is separated from the front of the queue. After a node has been removed from the front of the queue, the next person in the queue becomes the first to be service window and a departure node is added to the event list. At the end of simulation, when the event list gets empty, the total sum will be divided by the number of persons to obtain the average time spent by a person.

 

 

Posted Date: 7/10/2012 6:15:43 AM | Location : United States







Related Discussions:- Simulation of queues, Assignment Help, Ask Question on Simulation of queues, Get Answer, Expert's Help, Simulation of queues Discussions

Write discussion on Simulation of queues
Your posts are moderated
Related Questions
QUESTION Explain the following data structures: (a) List (b) Stack (c) Queues Note : your explanation should consist of the definition, operations and examples.

Q. Explain Dijkstra's algorithm for finding the shortest path in the graph given to us.  Ans: The Dijkstra's algorithm: This is a problem which is concerned with finding

human resource management project work in c++

Best Case: If the list is sorted already then A[i] T (n) = c1n + c2 (n -1) + c3(n -1) + c4 (n -1)  = O (n), which indicates that the time complexity is linear. Worst Case:

Illustrate the Back Face Detection Method A single polyhedron is a convex solid, which has no external angle between faces less  than 180° and there is a simple object space me

What will be depth do , of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node and last leaf node as node n

Q.   Draw the expression tree of the infix expression written below and then  convert it intoPrefix and Postfix expressions. ((a + b) + c * (d + e) + f )* (g + h )

give some examples of least cost branch and bound method..

Explain the Memory Function method The Memory Function method seeks to combine strengths of the top  down and bottom-up approaches  to  solving  problems  with  overlapping  su

A full binary tree with 2n+1 nodes have n non-leaf nodes