jeudi 26 février 2015

Program of Airport simulator


We want to simulate an airport landing and takeoff pattern. The airport has three runways, runway 0, runaway 1 and runway 2. There are four landing holding patterns, two for each of the first two runways. Arriving planes enter one of the holding patterns queues, where the queues are to be as close in size as possible. When a plane enters a holding queue, it is assigned an integer identification number and an integer giving the number of time units the plane can remain in the queue before it must land (because of low fuel level). There is also a queue for takeoffs for each of the three runways. Planes arriving in a takeoff queue are assigned an integer identification number. The takeoff queues should be kept approximately the same size. For each time period, no more than three planes may arrive at the landing queues and no more than three planes may enter the takeoff queues. Each runway can handle one takeoff or landing at each time slot. Runway 2 is used for takeoffs except when a plane is low on fuel. During each time period planes in either landing queue whose air time has reached zero must be given priority over other landings and takeoffs. IF only one plane is in this category, runway 2 is used. If there is more than one plane, then the other runways are also used. Use successive even (odd) integers for identification numbers of the planes arriving at takeoff (landing) queues. At each time unit assume that arriving planes are entered into queues before takeoffs or landings occur. Try to design you solution so that neither landing nor takeoff queues grow excessively. However, arriving planes must be placed at the ends of queues and the queues cannot be reconsidered.


Your output should label clearly what occurs during each time unit. Periodically, you should also output: (a) The contents of each queue (b) The average takeoff waiting time (c) The average landing waiting time (d) The number of planes that have crashed (run out of fuel and there was no open runway) since the last time period


Anyone help me please . Codes in C Programming Language.





Aucun commentaire:

Enregistrer un commentaire