Question: You will use the new LinkedQueue class to solve the following problem Suppose that certain airport has one runway. Each airplane takes landingTime minutes to


You will use the new LinkedQueue class to solve the following problem Suppose that certain airport has one runway. Each airplane takes landingTime minutes to land and takeOffTime to take off, and that, on the average, planes arrive at random instants of time. (Delays make the assumption of randomness quite reasonable.) There are two types of queues: a queue of airplanes waiting to land, and a queue of airplanes waiting to takeoff. Because it is more expensive to keep a plane airborne than have one waiting on the ground, we assume that the airplanes in the landing queue have priority over those in the takeoff queue. Write a program to simulate this airport's operation. You might assume a simulated clock that advances in five-minute interval. For each tic, generate two random numbers. If the first is less than landingRate, a "landing arrival" has occurred and is added to the landing queue; and if the second is less than takeOffRate, a "takeoff arrival" has occurred and is added to takeoff queue. In addition to simulating how queue get formed, and how planes get the authorization to land/takeoff, you program should calculate the average queue length and the average time that an airplane spends in a queue. You may also investigate the effect of varying arrival and departure rates to simulate the prime and slack times of day, or what happens if
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
