查看: 1731|回复: 3
|
Project难题,能不能guide我?
[复制链接]
|
|
Suppose that a certain airport has one runway, that each airplane takes landingTime minutes to land and takeOffTime minutes to take off, and that on the average, takeOffRate planes take off and landingRate planes land each hour. Assume that the 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 take off. Because it is more expensive to keep a plane airbone than to 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 one-minute intervals. For each minute, generate two random numbers: If the first is less than landingRate/60, a "landing arrival" has occurred and is added to the landing queue; and if the second is less than takeOffRate/60, a "takeoff arrival" has occurred and is added to the takeoff queue. Next, check whether the runway is free. If it is, first check whether the landing queues is nonempty, and if so, allow the first airplane to land; otherwise, consider the takeoff queue. Have the program calculate the average queue length and the average time that an airplane spends in a queue. You might also investigate the effect of varying arrival and departure rates to simulate the prime and slack time of day, or wat happens if the amount of time to land or take off is increased or decreased.
有没有什么网站能够找到相关的example吗?
版主按: 可否先让大家知道你对问题的了解,别一味的要求范例?
[ 本帖最后由 檞寄生 于 22-8-2007 09:53 AM 编辑 ] |
|
|
|
|
|
|
|
发表于 21-8-2007 12:15 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 21-8-2007 01:04 PM
|
显示全部楼层
原帖由 LyanneChan 于 21-8-2007 12:15 PM 发表 
http://javaboutique.internet.com/PatternSimulator/source.html
Im not sure whether this can help u
哦,谢谢你。。。
不大会java叻,若是用C++来写呢? focus在queue对吗? |
|
|
|
|
|
|
|
发表于 22-8-2007 04:20 PM
|
显示全部楼层
回复 #3 Mr.Tan 的帖子
没错
偶做过,format电脑没了 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|