Thread: Please advise on how I am going to start this problem...

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    30

    Smile Please advise on how I am going to start this problem...

    Suppose that a certain airport has one runway, that each airplane takes LandingTime minutes to land and TakeOffTime minutes to take off, and that on the average, TakeOffTime planes take off and LandingTime planes land each hour. Assume that the planes arrive at random instants of time. (Delays make the assumption to randomness quite reasonable.) There are 2 types of queues: a queue of airplanes waiting to land and a queue of airplanes waiting go take off. Because it is more expensive to keep a plane airborne than to have one waiting on the ground, we assume that the airplanes in the landing queue have priority over those in the take off queue.

    Write a program to simulate this airport’s operation. You might assume a simulated clock that advances in one-minute intervals. For each minute, generate two random numbers: If the first in less than LandingTime /60, a “landing arrival” has occurred and is added to the landing queue, and if the second is less than TakeOffTime /60, a “takeoff arrival” has occurred and is added to the takeoff queue. Next, check whether the runway is free. If it is, first check whether the landing queue is nonempty, and if so, allow the first plane to land; otherwise, consider the takeoff queue. Have the program calculate the average queue length and the average time that an airplane spends in a queue. You might also investigate the effect of varying arrival and departure rates to simulate the prime and slack times of day, or what happens if the amount of time to land or takeoff is increased or decreased.

    Thanks in advance...

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Start by opening an IDE and creating a new project. Next, make a queue implementation and create two instances of it in main...

    I don't know what you want to hear... everything you need is right there, if you have a more specific question than "How should I start this", I'd love to here it.
    Sent from my iPad®

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    30
    Thanks for a frank reply. I appreciate it.

    Okay, that would exactly my problem, "How should I start this"? Is there any link here in forum would be best described with this problem... So i can I study it.

    And hope you can help me. I know there is a rules here in forum. Just give the partial or idea on how should start this. Thanks....

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    As, I said, there is not much I can tell you. This problem asks you to make two queues... do you know how to do that? Then it asks you to simulate time... hopefully you know how to do that. Then it asks you to generate random numbers... do you know how to do that? Then it asks you to do a bunch of math and averaging on your results. The "runway" should be nothing more than a boolean value of whether a plane is on it or not that's true for a certain amount of cycles (as long as it takes for a plane to take off or land).

    I can't really give you more than that unless you give more to us.
    Sent from my iPad®

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. cannot start a parameter declaration
    By Dark Nemesis in forum C++ Programming
    Replies: 6
    Last Post: 09-23-2005, 02:09 PM
  3. Problem using java programs within C code
    By lemania in forum Linux Programming
    Replies: 1
    Last Post: 05-08-2005, 02:02 AM
  4. Linked List Anamoly
    By gemini_shooter in forum C++ Programming
    Replies: 3
    Last Post: 02-28-2005, 05:32 PM
  5. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM