Question: #402

Data Structures Airport exercise Solution

Write a program that simulates the operation of a busy airport that has only 2 runways to handle all takeoffs and landings. You may assume that each takeoff or landing takes 15 minutes to complete. One runway request is made during each five-minute interval, and the likelihood of a landing request is the same as for a takeoff request. Priority is given to planes requesting a landing. If a request cannot be honored, it is added to a takeoff or a landing queue.

Your program should simulate 120 minutes of activity at the airport. Each request for runway clearance should be time-stamped and added to the appropriate queue. The outputs of your program should include the final queue contents, the number of landings and takeoffs completed, and the average number of minutes spent in each queue.

Use a uniform random number generator to determine if a request is a landing request or a take-off request. Seehttp://www.cplusplus.com/reference/clibrary/cstdlib/rand/ for information on the basic C++ random number generator function rand. You MAY use STL data structures in the work.

Extra credit ( 20 points )
Instead of scheduling requests at a fixed five-minute interval, use a random number to determine the interval between takeoff or landing requests. Use an exponential random number for the interval. Show how the performance between this model and the base model differ.

Solution: #422

Data Structures - Airport exercise Solution

A+ grade guaranteed! I always give g...
Tutormaster
Rating: A+ Purchased: 11 x Posted By: Vikas
Related Solutions

No related questions were found.

Comments

Online Users