
March 12th, 2005, 06:08 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 9
Time spent in forums: 2 m 37 sec
Reputation Power: 0
|
|
|
Simulation Problem
Hi all, I have a simulation problem.
A phone line connecting 2 cities only operates from 8AM to 12AM (16 hours) everyday. Customers in these 2 cities randomly make phone calls through it. The distribution for the time interval between 2 calls is approximately an exponential function with lamda = 1/6 minutes^(-1). The distribution for the time each phone call lasts is approximately N(6,4) in minutes. When the line is busy, the next customer just gives up making his/her phone call. Write a program to simulate the phone line problem when there are n phone lines. (n is an arbitrary integer).
I know the algorithm to simulate 1 phone line, but am lost when it comes to a variable number of phone lines. All I can think of is to keep track of the time when a call ends that is the earliest of all the phone lines, and the next call is made to that phone line.
However, after updating that line, if another call comes in, I won't be able to find the phone line for that call to connect to without
going through all the phone lines and comparing the times. This is going to be a big problem is there are thousands of phone lines.
Can someone please help me?
Thank you.
Regards,
Rayne
|