C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 12th, 2005, 06:08 AM
wu_weidong wu_weidong is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 9 wu_weidong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Simulation Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway