implementing queue...example help

Hello.

I know this is a somewhat assignment like question but I just need to be clear what it asks and how it can be done i.e. pseudo code example/plain English algorithm
----------------------------------------------------------------------------

Investigate some of the properties of queues and write a program which simulates the queuing and service of a set of requests.
Input consists of a set of service requests each consisting of an arrival time and two service times. (Note: the arrival times are sorted in ascending order, two service times belongs to a primary and secondary servers each).
Your program should read the name of the data file from standard input and then read the data in the named file into the simulation. Run the simulation for a 50 service requests.
The simulation is to be of a system with two sets of servers, primary and secondary, with a single queue associated with each set. Customers arrive in the system and are served first by a primary server and, on completion of this service, by a secondary server. If the servers of a particular type are busy, the customer will enter either the primary or secondary queue as appropriate. The simulation should be run until the last customer has left the system.
The standard output of the queuing process will consist of the following data:
• Average waiting time of a service request Average waiting time = (Total time a service request waits in queue) / (Total number of service requests)
• Average total service time.
• Total idle time for each server.

-----------------------------------------------------------------------

I wish to know?

a) When a customer arrives for service what service/s should be performed, if any?

b) Should I just implement some queue operations on queue data consisting of an arrival time and two service times for each server which is start time and end time?

c) Should I read from a text file?

d) Do I have to implement multi threading to run two queues simultaneously?

e) Should I invoke System time?

thanks
a) When a customer arrives for service what service/s should be performed, if any?

Irrelevant.


b) Should I just implement some queue operations on queue data consisting of an arrival time and two service times for each server which is start time and end time?

It's unclear what you're asking. Queue operations usually consist of construction, pop or dequeue, and push or queue operations. What the elements stored in the queue represent are immaterial to the queue operations.


c) Should I read from a text file?

Your should read from your requirements: Your program should read the name of the data file from standard input and then read the data in the named file into the simulation.


d) Do I have to implement multi threading to run two queues simultaneously?

No.


e) Should I invoke System time?

No. It is a simulation. Simulate the passing of time.
Topic archived. No new replies allowed.