注册  找回密码

JBTALKS.CC


查看: 535|回复: 0

这里有一个关于Queue 的题目.

[复制链接]

35

主题

0

好友

286

积分

支柱会员

Rank: 4Rank: 4Rank: 4Rank: 4

发表于 2016-6-9 11:08 PM |显示全部楼层
这里有一个关于Queue 的题目.
我不是很明白这个的logic 和 source code 怎样写?请大家帮我解释解释谢谢.


Consider the case of an ATM center:
• It may have number of machines (servers) to serve customers
• If a customer arrives, the customer gets in line (queue)
• If the ATM is free and someone is waiting, then the first customer will use the machine.
• While a customer is using the machine, the time remaining for the customer to be served is decremented
• If there are customers in line, the additional minute that they have remained in the queue is recorded.
Develop a time-driven single server/single queue or multiple server/single queue system with following specifications:
• Jobs arrive at an average rate of 20 jobs per minute.
• When a job arrives (random jobID), the job is placed in a queue.
• The service time for a job varies from 3 seconds to 16 seconds (use random number and computer clock time)
• Jobs are served at a maximum of 7 seconds at once, if a job required service time more than 7 seconds, for the remaining service time the job is placed back on the queue (enqueue) again.

Run the simulator for 10 minute and report the following statistics:
1. The total number of jobs processed
2. Average number of jobs processed per minute.
3. The average arrival rate per minute
4. The number of jobs processed on the first attempt (one time).
5. The number of jobs had to be requeued once(require 2 times)
6. The number of jobs had to be requeued twice.(3 times)
For Multiple server/ Single queue system
1. Show sample jobs with assigned server ID,
2. Total number of jobs processed by each server






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

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2024-4-19 05:42 AM , Processed in 0.090328 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Thanks to ImageShack for Free Image Hosting
Ultra High-speed web hosting powered by iCore Technology Sdn. Bhd.
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | JBTALKS部落 | ICORE TECHNOLOGY SDN. BHD. | GXUnlimited-ECSHOP | TM UniFi | TM Streamyx | TM Fixed Line
www.jbtalks.cc | mobile.jbtalks.cc | www.jbtalks.com | www.jbtalks.my | www.icore.com.my | www.icorehosting.com | www.icorehosting.net | www.cttsite.com | www.icore.my | www.lpohchin.com
bbs.jbtalks.cc | bbs.jbtalks.com | bbs.jbtalks.my | bbs.jbtalks.com
回顶部