A simulated clock is initialized to 0 and the repeatedly advanced by 1 minute until it is equal to some given time limit(minutes). On each "tick" of a click, a check is made to determine if service has been completed for the current call, and if so, a new call is taken from the queue of calls that are waiting for service (if there are any), and its simulated service is initiated. A check is also made to determine if a new call has arrived. If it has, its arrival time is recorded, its service time is determined and recorded, and it is placed on the queue for processing in a first-come-first-serve manner when the agent becomes available. When the specified time limit has been reached, no new calls has been accepted, but service continues until all the calls in the on-hold queue have been processed.
When the simulation is complete, statistics such as number of calls processed and the average waiting time for each call that measure the performance of the information center must be reported. Also, during peak hours, some incoming calls may be rejected - because there is no room for them in the queue - and it may be useful to know the number of times that this occurs. These three statistics will constitute the output of this simulation.
- Number of calls processed
- Average waiting time per call
- Number of calls rejected
As we noted earlier, the simulation is to run for a specified period of time, and thus one input item must be a time limit. Since it is necessary to simulate the arrival and service of calls, information about arrival rates and service times is also needed. Thus the input will be
- Arrival rate of calls
- Distribution of service times
- Time limit
To determine whether or not a call has arrived in a particular minute, we generate a random number between 0 and 1, and if this number is less than arrival rate, we say that a call has arrived during this minute: (arrival rate is assumed to be 20%)
When a new call arrives, it's arrival time and the time required to service the call must be recorded. The values 0,50,0.75,0.90,1.00
I really need a C source code of a Queue Implementation of the given problem ..
Please .. T.T