代写C++代码 代做C++程序 C++辅导 C++教学

C++网络家教 远程写代码 在线Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

    CSCI203 

Your task for this assignment is to investigate some of the properties of queues.  

You should write a program which simulates the queuing and service of a set of requests.  

Input consists of the following data: 

 The number of primary servers in the system.  The number of secondary servers in the system. 

 A set of service requests each consisting of an arrival time and two service times. 

This set is terminated by a dummy record with arrival time and service times all equal to 0. (Note: the arrival times are sorted in ascending order). 

 

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.  

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 all 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.  

Output, to standard output will consist of the following data: 

 Number of people served. 

 Time last service request is completed.  Average total service time. 

 Average total time in queue(s). Both overall and separate.  Average length of queue. For each queue and overall.  Maximum Length of queue. For each queue and overall.  Total idle time for each server. 

 

Notes: Do not use classes – structs are ok but no function pointers in them.  Do not use the STL  There will be no more than ten servers of each type (20 total)  Each of the two queues will never have more than 100 people in them  

Programs must compile and run under gcc (C programs) or g++ (C++ programs). Programs which do not compile and run will receive no marks. 

Programs should be appropriately documented with comments.   

Assignments should be typed into a text file called ass2.c or ass2.cpp and submitted via the submit program.   

 submit -u user -c csci203 -a 2 ass2.c  or 

 submit -u user -c csci203 -a 2 ass2.cpp  

where your unix userid should appear instead of user.  


相关推荐