佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1731|回复: 3

Project难题,能不能guide我?

[复制链接]
Mr.Tan 该用户已被删除
发表于 21-8-2007 02:08 AM | 显示全部楼层 |阅读模式
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 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

LyanneChan 该用户已被删除
发表于 21-8-2007 12:15 PM | 显示全部楼层
http://javaboutique.internet.com/PatternSimulator/source.html

Im not sure whether this can help u


版主按:这是中文论坛,可否尽量以中文留言或发帖?

[ 本帖最后由 檞寄生 于 22-8-2007 09:49 AM 编辑 ]
回复

使用道具 举报

Mr.Tan 该用户已被删除
 楼主| 发表于 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对吗?
回复

使用道具 举报

LyanneChan 该用户已被删除
发表于 22-8-2007 04:20 PM | 显示全部楼层

回复 #3 Mr.Tan 的帖子

没错
偶做过,format电脑没了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 16-9-2025 11:26 PM , Processed in 0.120577 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表