airport

所属分类:数据结构
开发工具:C/C++
文件大小:181KB
下载次数:7
上传日期:2013-05-08 12:35:42
上 传 者taipei
说明:  【问题描述】假设机场有一条跑道,每架飞机需花费一定时间着陆,花费一定时间起飞,飞机的起降满足一定的概率。一般来讲,机场存在两个队列,一个等待着陆的飞机队列和一个等待起飞的飞机队列,同样等待时间下,等待着陆的飞机比准备起飞的飞机具有更高的优先级。试编写程序模拟这个机场的运行。 【基本要求】使用队列或优先队列实现;要求可以变换起飞和着陆频率来模拟一天中的飞行高峰期和空闲期;要求可以改变着陆和起飞时间以模拟不同的效果。 【实现提示】可以假设有一个每次前进一分钟的模拟时钟,对于每一分钟,产生两个随机数:如果第一个随机数小于landingRate/60,那么一个“着陆到达”将发生并被添加到着陆队列中;如果第二个随机数小于takeOffRate/60,那么一个“起飞到达”将发生并被添加到起飞队列中。接着,检查跑道是否空闲。若空闲,首先检查着陆队列是否为非空,如果是,允许第一架飞机着陆;否则,处理起飞队列。
(Description of the problem the assumption that the airport has one runway, each aircraft landing takes a certain period of time, take some time to take off, taking off and landing of aircraft to meet a certain probability. Generally speaking, the airport there are two queues, a queue waiting for the aircraft landing, and a waiting for takeoff the aircraft queue, the same wait time, waiting for the landing of the aircraft has a higher priority than the aircraft ready to take off. Try to write a program to simulate the operation of the airport. Requirements】 queue or priority queue implementation requirements can transform the frequency of take-off and landing day to simulate the flight peak periods and the idle period requirements can change the landing and take-off time in order to simulate different effects. [Tip] can be assumed to have an analog clock forward one minute at a time, every minute, resulting in two random numbers: If the first random number is less than landingRate/6)

文件列表:
airport\airport.cpp (6092, 2012-11-25)
airport\数据结构大型实验报告—机场航空管制模拟.doc (357376, 2012-06-26)
airport (0, 2013-05-08)

近期下载者

相关文件


收藏者