Airport Simulation: 

 

Take a very close look at the Car Wash program in chapter 8. It is a very well-designed and insightful program that introduces key concepts that are used in design of the Airport Simulation program. (You must use the concepts and classes used in the Car Wash project in your project.)

You will be using your own Queue class for this project. 

Running the Car Wash program using your own Queue class and providing detailed comments will be very helpful in implementing the Airport Simulation program. You need to know exactly how the different pieces fit together. Doing this will cut your development time in half.

Submit all your source files (including queue.h) along with your output.

 Here are some of the variables your program will keep track of:

unsigned int takeoff_time,      //how long it takes for a take off once plane 
// is on the runway
double takeoff_probability, //probability of arrival of a plane into the
// take off line
unsigned int landing_time, //how long it takes for a plane to land on the
// runway in each second
double landing_probability, //probability of arrival of planes for landing
// in each second
unsigned int fuel_limit, //maximum amount of time a plan can stay in
// landing queue without crashing
unsigned int total_time; //total time you will run the simulation.

 

 

If I were you, I would write a class to take care of all these variables and to perform the simulation.

 Run your program once with the debug flag on (printing all your debugs) and once without the debug so it prints the results only.

Use these values to test your program. (Thanks to Andrew Miner for these values)

    unsigned int time_to_land = 5;
    unsigned int time_to_take_off = 15;

    double landing_probability = 0.10;
    double takeoff_probability = 0.8;

    unsigned int fuel_limit = 20;
    unsigned int simulation_time = 1440;


Sample (no debug) run:

============================================
time to take off      : 15
time to land:         : 5
probability of landing: 0.1
probability of takeoff: 0.08
fuel: time to crash   : 20
total simulation time : 1440


. . . . . . . . . . . . . . . . . . . . . . . 
145 landed
48 took off
2 planes crashed. :(
Average waiting time to land: 9
Average waiting time to take off: 457.271
planes in landing queue : 0
planes in take off queue: 72
============================================  

Run this program a few dozen times and see how the results will differ.

Also try running for a much longer period of time like 100000. Try running this a few times and report your observations.

REPORT YOUR FINDINGS in the "work report comments"